Set value of enum with calculated script
Hello,
After succeding in getting value from enum, I'm now trying to set a calculated value into an enum
I'm using
workItem.setValue(attributeId, enumLiteral);
It works, but the value isn't changed on the fly. It is changed only after saving the workitem.
Is it possible to make it change on the fly when we change the value of another enum without saving the WI ?
Thank you for your help
Accepted answer
Hi Sany,
instead of workItem.setValue, try applying the calculated value script directly onto the attribute, just return the value from the script. the returned value would directly get set onto the attribute then. this should show the changes as soon as the dependent attribute is changed.
if you are using the same script to set multiple enum attributes, you could try a conditional return as in :
if (attributeId === "enumattributeid_1")
return "literalidapplicablefor_1"
if (attributeId === "enumattributeid_2")
return "literalidapplicablefor_2"
so on...
Comments
Sunny Kumar
Jan 19 '23, 8:01 a.m.Hi Sany,
David Honey
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Jan 19 '23, 12:41 p.m.Gagan Kumar there is already an accepted answer to this question provided almost 6 years ago. If you have new questions to ask, please post your own question.