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 Comments
SEC Servizi
commented May 15 '13, 11:22 a.m.
There is an API constant to refer to the 'Unassigned' value? |
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. |
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.