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

Getting Time Spent by plain java API

Hello,

I try to get the time spent attribute by plain java API.

In IWorkItem is a getter for duration available, but this is the estimated time.

The id of time spent is according to the administration web interface timeSpent and of estimated time duration.

Is there a way to get the value of time spent through the plain java API?

Best regards

0 votes



2 answers

Permanent link
Hello,

in a earlier post I found a solution to my problem. https://jazz.net/forums/viewtopic.php?t=2379&highlight=spent

I tried the suggested way. If the attribute is not set I get -1 else 0 is returned. How can I get the concret value of time spent?

My code is:


IWorkItemCommon workItemCommon = (IWorkItemCommon) repository
.getClientLibrary(IWorkItemCommon.class);

IAttribute timeSpentattribute = workItemCommon.findAttribute(
projectArea, WorkItem.TIME_SPENT_PROPERTY, monitor);

Object o = rtcWorkItem.getValue(timeSpentattribute);



Best regards

0 votes


Permanent link
Hello,

I figured out, that it is not the code, that is wrong.

In the field time spent I do not type in the time I have already spent on that item. It is the time remaining. The program calculates estamated time - the in time spent typed in time and this is time spent in the attribute.

In my case estemated and time spent were always the same and I got 0.

Is the assumption of this behavior right and is it possible to type in time spent?

Best regards

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,949

Question asked: Mar 15 '12, 11:26 a.m.

Question was seen: 7,029 times

Last updated: Mar 15 '12, 11:26 a.m.

Confirmation Cancel Confirm