Enumeration literals for custom fields with RTC API on server side
Hello!
To get custom fields values, I use such code in my own Rational Team Concert follow-up action: // Get custom attributes List<IAttributeHandle> wi_customs = wi.getCustomAttributes(); But all my experiments failed when I was trying to extract enumeration displayed values (or literals) for these fields. Here I can get the enumeration identifiers only but not literals. Does somebody knows how I could get them on the server side of my RTC custom extension? Thank you very much in advance! |
Accepted answer
Ralph Schoon (63.5k●3●36●46)
| answered Sep 15 '14, 3:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
You can access the data like this using IWorkItemCommn:
fWorkItemCommon = getService(IWorkItemCommon.class); // Iterate the enumeration literals and create IEnumeration targetEnumeration = fWorkItemCommon .resolveEnumeration(enumerationAttribute, monitor); List literals = targetEnumeration .getEnumerationLiterals(); for (ILiteral targetLiteral : literals) { ....... } Also see https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ Dmitry A. Lesin selected this answer as the correct answer
Comments As far as I know you get the literal ID's and have to iterate the enumeration to get the display value.
sam detweiler
commented Sep 15 '14, 7:48 a.m.
the data stored in the database for the enumeration is the values ID.
Dmitry A. Lesin
commented Sep 16 '14, 1:20 p.m.
Thanks to everybody who was answering my question!
next prerequisite should be added into plugins.xml:
<requiredService interface="com.ibm.team.workitem.common.IWorkItemCommon"/>
|
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.