Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



2 answers

Permanent link
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

0 votes

Comments

There is an API constant to refer to the 'Unassigned' value?


Permanent link
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.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,943

Question asked: Jun 13 '08, 9:52 a.m.

Question was seen: 6,042 times

Last updated: May 15 '13, 11:22 a.m.

Confirmation Cancel Confirm