How to set value of custom attribute type Enumeration?
Hi,
Can anybody tell me how can we set value for custom attribute of type Enumeration? When trying to set a string value getting exception as: "java.lang.String incompatible with com.ibm.team.workitem.common.model.Identifier" Any suggestion or piece of code would be a great help. Thanks. |
Accepted answer
Ralph Schoon (63.7k●3●36●48)
| answered Sep 28 '19, 9:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
See https://rsjazz.wordpress.com/2012/08/20/manipulationg-work-item-enumeration-values/ and https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/
Pretty much any attribute type is explained there. Also see https://rsjazz.wordpress.com/2019/07/03/work-item-command-line-5-0/ and the attached source code that reads and writes almost all attribute types as well.
Ralph Schoon selected this answer as the correct answer
|
4 other answers
Sterling Bates (231●16●12)
| answered Nov 21 '11, 12:16 p.m.
edited Sep 27 '19, 2:15 p.m. by David Lafreniere (4.8k●7) Any help?
String enumAttributeName = "version"; |
Any help?
I have seen one article stating how to set value for Filed against. but how to deal with custom enumeration attributes? Any body? |
Any help? well you have to create the value object(Identifier) first, then setValue(attribute, object) should work. This is an OO system how do you create an Identifier? I would look up its constructors in Eclipse, this is click on the classname, and select 'Open Declaration' from the popup menu (or hit f3 if u can remember the keystroke mnemonics) Sam |
Is there anyway to get an IEnumeration directly without having an attribute of that enumeration type (Not calling resolveEnumeration) in the Java API?
Basically, what I have is an attribute on a work item that should be a multi select attribute. To set this up I created an attribute of type string, and added a presentation editor that attaches an enumeration to the custom attribute. When multiple values of the enumeration are selected, the string value of the custom work item is something like "test.multiselect.enumeration.l1,test.multiselect.enumeration.l2" and I need a way of first knowing that this custom attribute of type string is actually a multi select, and second translating the values of the enumeration literals to the display names. Thanks for any help, -ryan |
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.