RTC 5.0 JavaAPI How setValue TimeSpent ?
It has created a process of acquiring the attribute object of Times pent.
But, the object will become null. IAttribute attribute = workItemClient.findAttribute(IWorkitem.getProjectArea(), "internalTimeSpent" , null) getWorkItem().setValue(attribute, timespentvalue.longValue()); [result] attribute = null Project area variable is to get the correct information. IWorkitem.getProjectArea() thanks regard!! |
2 answers
Hi, I don't know where you find that time spent field id, but I think you should use WorkItemAttributes.TIME_SPENT as field id to get the time spent.
Michele. Comments
HIROAKI JOSAKO
commented May 12 '16, 5:36 a.m.
Hi
Michele Pegoraro
commented May 12 '16, 5:45 a.m.
I don't think I ever seen this article before (and I'm not seeing the "internalTimeSpent" id either), anyway I generally use the attribute I wrote (I prefer use class defined constants for internal field ) and it works so I suggest you to give it a try.
HIROAKI JOSAKO
commented May 12 '16, 10:54 p.m.
I'm sorry.
Michele Pegoraro
commented May 16 '16, 4:36 a.m.
As I was saying: the id to be used in the .getValue method is the one that you can obtain from this property: com.ibm.team.workitem.api.common.WorkItemAttributes.TIME_SPENT
HIROAKI JOSAKO
commented May 23 '16, 9:19 p.m.
understood.
Michele Pegoraro
commented May 24 '16, 5:09 a.m.
Which version are you using?
public static final String TIME_SPENT= "timeSpent"; //$NON-NLS-1$By the way you can use "timeSpent" hard coded, I only prefer to use the api constant, as I think it is safer.
showing 5 of 6
show 1 more comments
|
Ralph Schoon (63.1k●3●36●46)
| answered May 24 '16, 5:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
The work item command line https://rsjazz.wordpress.com/2015/11/03/a-rtc-workitem-command-line-version-3-0/ reads and sets time spent. The downloadable code is attached. It should be easy enough to look up the code.
There is no constant on IWorkItem if you look up the attribute ID in the Web Admin UI, it is "timeSpent". I set it with a new Long(String); |
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.