Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Dojo Scripting setting value for enumeration

dojo.provide("org.example.workitems.providers.SeverityTagValueSet12");

dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
dojo.require("dojo.string");

(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;

dojo.declare("org.example.workitems.providers.SeverityTagValueSet12", null, {

    getValue: function(attributeId, workItem, configuration) {
    
        var tags= workItem.getValue(WorkItemAttributes.PRIORITY);
        var severityOptions= [];
        
        if (tags=="priority.literal.l02") {
            severityOptions.push("severity.literal.l4"); // Unclassified
            
        }
        
        
        

        return severityOptions;
    }
});
})();


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?

0 votes



2 answers

Permanent link

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.

0 votes

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


Permanent link
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);
        }
    });
})();


    

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927

Question asked: Jun 26 '20, 4:53 a.m.

Question was seen: 1,617 times

Last updated: Jun 29 '20, 7:11 a.m.

Confirmation Cancel Confirm