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 (62.3k●3●36●43)
| 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.
the data stored in the database for the enumeration is the values ID.
Thanks to everybody who was answering my question!
next prerequisite should be added into plugins.xml:
<requiredService interface="com.ibm.team.workitem.common.IWorkItemCommon"/>
|