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
|
2 answers
Try AttValueList[i].content
Comments
Janet Cook
commented Dec 10 '23, 7:46 p.m.
Thanks Davyd
Tried that and it gives me undefined for all values.
Any further ideas?
Janet
Davyd Norris
commented Dec 11 '23, 2:17 a.m.
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
|
Thanks Davyd,
Tried that and it gives me undefined for all values when I know some of them are set.
Any furhehr ideas?
Janet
|
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.