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

RTC How to get the values of a Enumerated list in script

 Workflow manager (RTC) 7.0.2


I have a attribute that is a enumerated list thus having possibly multiple values. I need to query these values in a script to set another attribute but it seems not to work. I can get the number of values that are set, but how to I get to the actual values?  Code I have is

       var AttValueList = workItem.getValue("change_system");
       var numvals = AttValueList.length
       var System = "TESTXXXX...";
       for (var i = 1; i <= numvals; i++) {
           System = System + i +  AttValueList[i].id  
// the above line works without the
     // +  AttValueList[i].id 
//  part so I know I am going through the loop

// what I am really after is this
//        if (AttValueList[i].id === "SystemENUM.literal.l2") {System = System + "RS ";}
       }

I must be missing something simple but cannot figure it out.
Thanks

0 votes



2 answers

Permanent link

Try AttValueList[i].content

0 votes

Comments

 Thanks Davyd


Tried that and it gives me undefined for all values.

Any further ideas?
Janet

Hmmmm - that's what you use for String Lists, but it looks like Enumeration Lists are a lot quirkier.

I've just been digging round in the code and they are not treated the same way as either String Lists or Enumerations. They seem to be considered Value Sets but the code that retrieves the values is very obscure. I'll do some more digging


Permanent link

 Thanks Davyd,

Tried that and it gives me undefined for all values when I know some of them are set.
Any furhehr ideas?
Janet

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
× 12,020

Question asked: Dec 10 '23, 6:57 p.m.

Question was seen: 859 times

Last updated: Dec 11 '23, 2:17 a.m.

Confirmation Cancel Confirm