Dojo Scripting setting value for enumeration
dojo.provide("org.example.workitems.providers.SeverityTagValueSet12");
I am trying to get when i select the Priority low automatically the severity should get set the value major.But it... is creating some java obeject@@26 enumeration value. any problem in script?
|
2 answers
Ralph Schoon (63.6k●3●36●46)
| answered Jun 29 '20, 2:24 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER The script is for a value set - which would provide the available choices. It does not set any values. Only calculated values return one value that is then set.
Comments
Ya i got it..I am using getValue. So can you please help me to set the value in same scenario or let me know how to.In links i can only see for age of workitem like maths calculation. How to set the value in enumeration automatically?
return "severity.literal.l4" will work
|
Ralph Schoon (63.6k●3●36●46)
| answered Jun 29 '20, 7:11 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Jun 29 '20, 7:11 a.m.
This is an example of a calculated value provider:
/******************************************************************************* * Licensed Materials - Property of IBM * (c) Copyright IBM Corporation 2011. All Rights Reserved. * * Note to U.S. Government Users Restricted Rights: * Use, duplication or disclosure restricted by GSA ADP Schedule * Contract with IBM Corp. *******************************************************************************/ dojo.provide("com.example.ValueProvider"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("com.example.ValueProvider", null, { getValue: function(attribute, workItem, configuration) { var prio = workItem.getValue(WorkItemAttributes.PRIORITY); if (prio == "priority.literal.l02") { return "severity.literal.l4"; // Unclassified } return workItem.getValue(attribute); } }); })(); |
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.