Converting enumeration attribute values to consumable String
![]()
Hello,
I'm trying to retrieve the value of a workItem attribute, which is an enumeration type. When I call the IWorkitem.getValue(IAttribute) method, I get the following String: com.ibm.team.workitem.common.model.ILiteral:enumRepeatability.literal.l6 I was expecting a value of "Unassigned". Therefore how can I derive the actual value I'm looking for? Thanks in advance. |
2 answers
![]()
Hi
You can resolve the enumeration using: IWorkItemCommon#resolveEnumeration(IAttributeHandle attribute, IProgressMonitor monitor), which returns an IEnumeration. This can be asked about a literal for a certain id (in your case 'enumRepeatability.literal.l6'). On the literal, getName should return the expected 'Unassigned'. HTH Marcel Jazz Work Item team |
![]()
Yes, thanks very much Marcel.
I already implemented it through that method - by retrieving all the literals from the IAttribute's IEnumeration, and iterating through them while doing an id comparison. When found, I'd invoke the getName on the literal. |