How does one Get and Set value of Work Item's Found-In attribute programmatically?
Steven Melcher (60●1●28●32)
| asked Jul 03 '12, 12:01 p.m.
edited Jul 03 '12, 1:26 p.m. by Geoffrey Clemm (30.1k●3●30●35)
In RTC 2.0, how do you get and set the value of a work item's Found In attribute using the Java API?
|
2 answers
Ralph Schoon (63.6k●3●36●46)
| answered Jul 04 '12, 3:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Please have a look at: https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation
You can use the operation also to update work items, this saves you trying to work with working copies. You want to set the value of the attribute: com.ibm.team.workitem.attribute.version the data type is IDeliverables. Some hint on IDeliverables: https://jazz.net/library/article/807 there are several ways to find them. |
Ralph Schoon (63.6k●3●36●46)
| answered Jul 04 '12, 3:23 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Forgot: To set an internal attribute:
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class); IAttribute attribute = workItemClient.findAttribute(workItem.getProjectArea(), fAttributeID, monitor); if(null!=attribute){ if(workItem.hasAttribute(attribute)) workItem.setValue(attribute, fValue); } To get use gatValue and cast. For custom attributes use hasCustomAttribute which also works for built in attributes. |
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.