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

How can we access the database-enumeration values using javascript?

I have some database-enumerations which I'm trying to set their values automatically based on other attribute or enumerations values. The problem is that the enumeration is stored in the database and I can't retrieve or set the values.

Below is a script that gets the selected value from one database-enumeration and return a specific value that should be set into another database-enumeration, but it's not working. Not sure if I should use another way to work with the database-enumerations.

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

(function() {
    dojo.declare("com.example.GrowthPlatformContractOwnershipAutoPopulationFromServiceLineContractOwnership", null, {
    getValue: function(attributeId, workItem, configuration) {

try {
var serviceLineContractOwnership = workItem.getLabel("ContractOwnership_List");
switch (serviceLineContractOwnership) {
case "ADM Innovation":
return "CAI";
break;
default:
return "Please Select";
}
}
catch(err) {
            var txt;
            txt="There was an error on this page.\n\n";
            txt+="Error description: " + err.message + "\n\n";
            txt+="Click OK to continue.\n\n";
            alert(txt);
        }
    }
    });
})();

0 votes


Be the first one to answer this question!

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: Sep 25 '18, 4:35 a.m.

Question was seen: 1,739 times

Last updated: Sep 25 '18, 4:35 a.m.

Confirmation Cancel Confirm