It's all about the answers!

Ask a question

RTC Script based Condition

Peterson dos Santos (3928) | asked Jun 24 '19, 10:24 a.m.
edited Jun 24 '19, 10:34 a.m.

Hi Dears,

I'd like to know  if is there a exemple script that check if there is a enumeration list (check box), selected, case positive set up other atribuite like  not required.

I looking for that, but no found a example yet,

Thank you for support,

Ralph Schoon commented Jun 24 '19, 1:34 p.m.

I have tried several times to use JavaScript with list type attributes and have never been successful. I think the JavaScript API does not officially support the list attributes.  The available documentation does not list the list types and I think I have always been unable to configure value provider or value sets for them. There might be internal API I do not know.

I am pretty sure that it is possible to do this with a Java based condition, however that needs to be deployed.

One answer

permanent link
Davyd Norris (2.4k217) | answered Jun 24 '19, 10:52 p.m.
edited Jun 25 '19, 12:19 a.m.
Selected items in enumeration lists are returned as an array of Objects, so this will do it for you:

      var someEnumerationList = workItem.getValue('my Attribute Id');
      someEnumerationList.forEach(function(item) {
        console.log(item.label); //label property is the text of the selected item

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.