It's all about the answers!

Ask a question

How do I get an EnumerationList (multiple choice)?


Kodac Hasubo (364) | asked Feb 24 '22, 3:10 a.m.
 I'm using the Java EWM plugin in RTC7.0.2.

I don't know how to get the value of the Multiselection List( Enumeration List )

How can we get it?

Accepted answer


permanent link
Kodac Hasubo (364) | answered Feb 24 '22, 7:59 a.m.

I am sorry. I solved it in the following way. 

 IAttributeHandle attributeHandle = workItemServer.findAttribute(iProjectArea, attributeName, monitor);

  IAttribute artifactAttribute = (IAttribute) itemService.fetchItem( attributeHandle, IRepositoryItemService.COMPLETE );

  Object artifactObj = workItem.getValue(artifactAttribute);
 
  ArrayList list = (ArrayList<String>) artifactObj;
  
  for( int i=0;i < list.size() ; i++ ){
 
   IEnumeration enumeration = workItemCommon.resolveEnumeration( artifactAttribute, monitor );

   ILiteral literal = enumeration.findEnumerationLiteral( (Identifier<ILiteral>) list.get( i ) );


   targetName = literal.getName();

  }
  

Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented Feb 24 '22, 8:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The question would have been, how do I access work item attributes of type enumeration list using the EWM SDK or the Plain Java API. I would have suggested to look into  https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/

One other answer



permanent link
Ralph Schoon (63.1k33645) | answered Feb 24 '22, 3:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Click on attribute in editor, see the results. 


If you expect a different answer provide a better question. E.g. read How should I ask a question in the Forum if I want to receive useful answers? and modify your question accordingly. Sigh, my answer is already way longer than the original question.

Your answer


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