Work Item Time Spent and Correction Attribute Values
2 answers
I have the same question. We would like to extract the value of "correction", so far we get only "Time estimate" even if correction is set with a value. My understanding is that these fields are somehow tied together. Any help on this is appreciated.
I have found a way, hope it's safe...
public static long getCorrectedEstimate(IWorkItem theWorkItem) {
long retval = theWorkItem.getDuration();
IItem item = theWorkItem.getFullState();
if (item instanceof WorkItemImpl) {
WorkItemImpl wii = (WorkItemImpl) item;
long corrected = wii.getCorrectedEstimate(); //or wii.getTimeSpent();
if (corrected >= 0)
retval = corrected;
}
return retval;
}