How to change the value of Attributes Time Spent etc?
8 answers
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
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:
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?
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?
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
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?
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
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.