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