Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to change the value of Attributes Time Spent etc?

Hello Jazz Team,

how can I change the values of the attributes Time Spent and Corrected with help of a plain Java Program? Any ideas? I know how to change the value of estimated time, but there is no method to change Time Spent.

Greetz Christopher Zuendorf

0 votes



8 answers

Permanent link
how can I change the values of the Attributes Time Spent and Corrected
with help of a plain Java Program? Any ideas? I know how to change
the value of estimated time, but there is no method to change Time
Spent.

You could use the generic setValue API on IWorkItem:

IAttribute timeSpentAttribute= workItemClient.findAttribute(projectArea,
WorkItem.TIME_SPENT_PROPERTY, monitor);
workingCopy.setValue(timeSpentAttribute, timeSpent);

HTH,
Patrick
Jazz Work Item Team

0 votes


Permanent link
It works! THX.

0 votes


Permanent link
I'm using RTC 2.0, and there isn't IWorkItem.TIME_SPENT_PROPERTY. I only found IWorkItem.DURATION_PROPERTY.

Is it the same?

I try to use:


IItem item = workItem.getFullState();
if (item instanceof WorkItemImpl) {
WorkItemImpl wii = (WorkItemImpl) item;
long timeSpent = wii.getTimeSpent();
}


But it gives warning of "Discouraged access: The type WorkItemImpl is not accessible due to restriction on required library".

So, how can I get TimeSpent programmatically inside a Participant?

0 votes


Permanent link
Anyone?

0 votes


Permanent link
I'm using RTC 2.0, and there isn't IWorkItem.TIME_SPENT_PROPERTY. I
only found IWorkItem.DURATION_PROPERTY.

Is it the same?

I try to use:


IItem item = workItem.getFullState();
if (item instanceof WorkItemImpl) {
WorkItemImpl wii = (WorkItemImpl) item;
long timeSpent = wii.getTimeSpent();
}


But it gives warning of "Discouraged access: The type
WorkItemImpl is not accessible due to restriction on required
library".

So, how can I get TimeSpent programmatically inside a Participant?

The pattern for getting work item attributes is always:

IAttribute attribute= workItemCommon.findAttribute(projectArea,
attributeId, monitor);

Object value= workItem.getValue(attribute);

--
Regards,
Patrick
RTC Work Item Component Lead

0 votes


Permanent link
I'm using RTC 2.0, and there isn't IWorkItem.TIME_SPENT_PROPERTY. I
only found IWorkItem.DURATION_PROPERTY.

Is it the same?

I try to use:


IItem item = workItem.getFullState();
if (item instanceof WorkItemImpl) {
WorkItemImpl wii = (WorkItemImpl) item;
long timeSpent = wii.getTimeSpent();
}


But it gives warning of "Discouraged access: The type
WorkItemImpl is not accessible due to restriction on required
library".

So, how can I get TimeSpent programmatically inside a Participant?

The pattern for getting work item attributes is always:

IAttribute attribute= workItemCommon.findAttribute(projectArea,
attributeId, monitor);

Object value= workItem.getValue(attribute);

--
Regards,
Patrick
RTC Work Item Component Lead

Ok, but where can I find time spent, estimated and corrected attributes IDs?

0 votes


Permanent link
Ok, but where can I find time spent, estimated and corrected
attributes IDs?

com.ibm.team.workitem.common.internal.model.WorkItem.CORRECTED_ESTIMATE_PROPERTY
com.ibm.team.workitem.common.internal.model.WorkItem.TIME_SPENT_PROPERTY
com.ibm.team.workitem.common.model.IWorkItem.DURATION_PROPERTY

--
Regards,
Patrick
RTC Work Item Component Lead

0 votes


Permanent link
Ok, but where can I find time spent, estimated and corrected
attributes IDs?

com.ibm.team.workitem.common.internal.model.WorkItem.CORRECTED_ESTIMATE_PROPERTY
com.ibm.team.workitem.common.internal.model.WorkItem.TIME_SPENT_PROPERTY
com.ibm.team.workitem.common.model.IWorkItem.DURATION_PROPERTY

--
Regards,
Patrick
RTC Work Item Component Lead

Thank you! That will be very useful...

If you don't mind, I have just one little doubt... Why CORRECTED_ESTIMATE_PROPERTY and TIME_SPENT_PROPERTY isn't at IWorkItem like the others attributes Ids?

Anyway, thank you again.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Oct 09 '08, 3:06 a.m.

Question was seen: 9,896 times

Last updated: Oct 09 '08, 3:06 a.m.

Confirmation Cancel Confirm