It's all about the answers!

Ask a question

How to update one Enumeration label into another enumeration attribute using java script


Pallavi Deore (38141) | asked Aug 07 '20, 3:16 a.m.

Hi,


We wanted to update one enumeration attribute label into another enumeration attribute using java script.
I wanted to create calculate script to update values.
Suppose one attribute UoM has literal label "Monthly" and another enumeration attribute PDE UoM has literal label as "Monthly" then I want same label to be updated from UoM to PDE UoM attribute on Draft state of WI.
Kindly provide me the syntax to update enumeration label using java script in rtc.

Regards
Palalvi Deore

One answer



permanent link
Ralph Schoon (63.1k33646) | answered Aug 07 '20, 5:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Aug 07 '20, 5:59 a.m.

 You can learn how calculated values work here: https://jazz.net/library/article/1093 Version: IBM Rational Jazz Collaborative Lifecycle Management Process Enactment Workshop for RTC . 


The calculated value for the new attribute would do a workitem.getValue() or workitem.getLabel() for the original attribute ID. Then it would use an if then else section to return the correct literal ID for the new attribute. 

The use case description and the reason for it is not clear. My best guess is that you want to migrate from one enumeration to another. Based on that assumption this is NOT the solution you want, as you would have to manually open all work items in the UI to make the changes to come into effect.

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.