Programmatic read value of custom attributes
Hi all,
i need to read custom attributes value: i wrote some code but i get always the same error ( using working copy too ):
this is my code to read the value: IWorkItemServer workItemServer = getService(IWorkItemServer.class); Thanks |
3 answers
Hi,
first you have to retrieve the attribute using findAttribute method, and then you have to use IWorkItem.getValue(IAttribute) method, casting the returned value (if it is an enumeration is quite more complex). Before the getValue maybe you want to run the IWorkItem.hasAttribute(IAttribute) in order to be sure that the work-item has the attribute you need. Best Regards, Michele. |
I have the same issue. Any one has the solution?
|
Ralph Schoon (63.5k●3●36●46)
| answered Sep 10 '13, 1:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 10 '13, 1:37 a.m.
If you use the client API this is described here: http://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/
If you use a server API, here are examples http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/ You use the ID of the custom attribute to find the IAttribute. Basically you find the IAttribute using the ID and then getValue() the value and cast it to a matching type. |
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.