Set automatically enum literal using Calculated Value script
Hello,
I'm trying to set automatically an "Unassigned" literal in my Application enum if work item status is "Failed". When I move to Failed status, ID literal is add as new value in the enum.
This is the script that I have created:
dojo.provide("org.example.ClearOnValue"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("org.example.ClearOnValue", null, { I have review the following links:
In my Application attribute, I assigned my script and status attribute as dependency.
Can you help me to know if I need to configure any ?
Thanks for your help.
|
2 answers
Ralph Schoon (63.6k●3●36●46)
| answered Aug 23 '18, 3:00 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
|
Hi Ralph, Thanks for your reply. I review all the lines into my script and I had these errors: 1. As you commented, I added the closing apostrophe in this line: return workItem.getValue("testAttribute.application"); 2. I put a wrong ID for "Unassigned" literal. Before: if (state == "bugzillaWorkflow.state.s10") { return "com.sw.att.pc.enum.application.literal.l2"; } After: if (state == "bugzillaWorkflow.state.s10") { return "com.sw.att.pc.enum.applicacion.literal.l8"; } My question was why the returned literal (ID) was being added as a new literal. This was happening because the ID was wrong for “Unassigned” value. Thanks for your help. Regards |
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.