setValue in custom enumeration
How can I set a value in a custom enumeration?
I use this code for example to set the Priority IAttribute priority = service.findAttribute(projectArea,IWorkItem.PRIORITY_PROPERTY, monitor); But I don't know how to set the value in custom enumeration. Thanks in advance. |
One answer
cargne80 wrote:
How can I set a value in a custom enumeration? it works basically the same as in the example above, except that you need to load your custom attribute by ID, then use ILiteral instead of IPriority IAttribute myAttribute= workItemCommon.findAttribute(projectArea, "myCustomAttributeId", monitor); IEnumeration<ILiteral> enumeration= (IEnumeration<ILiteral>)workItemCommon.resolveEnumeration(myAttribute, monitor); List<ILiteral> literals= enumeration.getEnumerationLiterals(); ILiteral literal = literals.get(2); workItem.setValue(myAttribute, literal.getIdentifier2()); -- MikeS Jazz Agile Planning team |
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.