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

How to set enumeration selected value to a long type attribute by using dojoscript in a workitem

 Hii,


I need to know how to set an enumeriation selected value to a long type attribute in a Workitem. I had a enumeration attribute with values 1.1, 1.2, 1.3, If I selects 1.1 then it need to update in the long type custom attribute I need to know is it possible because I tried the below coad but not working.

dojo.provide("com.example.m");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

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

    dojo.declare("com.example.m", null, {

        getValue: function(attribute, workItem, configuration) {
            var prio1 = workItem.getValue("testd"); 
     
             console.log("prio3"+ prio1);          
            return prio3;
        }
    });
})();

Please help me in this.

Thank you,

Regards,
Pavan.

0 votes



One answer

Permanent link

 You can use a calculated value for this kind of stuff. The script above is not going to return anything as it tries to return an undefined value. 



I would suggest to look up the "Process Enactment Workshop" in the menu item Library above, and go through the last two labs. That should provide you with what you need. console.log is not necessary, you can debug the scripts.

https://jazz.net/wiki/bin/view/Main/AttributeCustomization explains the API. E.g. for enumerations you get literals as value - which are represented as literal identifier or as display value, dependent if you use getValue() or getLabel(). 

There are nice JavaScript tutorials one google hop away that explain how to create numbers from strings.

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

Question asked: Dec 16 '21, 6:22 a.m.

Question was seen: 1,291 times

Last updated: Dec 16 '21, 7:16 a.m.

Confirmation Cancel Confirm