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

CLM 6.0.2: Calculated Value - Cannot load the script class

 I have the following scenario:

Attribute A (single pick enum, strings):  Value1, Value2, Value3 
Attribute B (single pick enum, strings):  Value4, Value5, Value6 
Attribute C (boolean): default false

I am trying to write a calculated value script for Attribute C:
If Atribute A == Value1 AND AttributeB == Value4
           AttributeC = true

But I can't get the script to load and am getting the following errors:

Developer Window (Chrome): 
Problems executing value provider for {0}: Cannot load the script class - com.mycom.scriptName

ccm.log:

com.ibm.team.rtc.common.scriptengine.UnknownTypeException: 'com.mycom.scriptName' is not a constructor

Below is my code:

dojo.provide("com.mycom.scriptName");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
//var doDebug = true;
var scriptname = "scriptName";
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var attribC= false;
    dojo.declare("com.mycom.scriptName", null, {
       
console.log("Start");

        getValue: function(attribute, workItem, configuration) {
var attribA= workItem.getValue("com.mycom.AttributeA");
var attribB = workItem.getValue("com.mycom.AttributeB");

if (attribA == "com.mycom.enum.AttributeA.literal.l2" && attribB == "com.mycom.enum.AttributeB.literal.l2") {
                                   attribC = true;
                          }

return attribC ;
}   
    });
})();

0 votes


Accepted answer

Permanent link
I figured it out.  I was referencing the wrong attribute name in one place and I removed all the console.log statements.
Ralph Schoon selected this answer as the correct answer

0 votes

Comments

The error indicates a syntax error or maybe unexpected character, so it is likely not the console.log and maybe not even the wrong ID. However, you corrected it somehow.

Thank you.  I will keep that in mind for next time.

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,944
× 4

Question asked: Aug 08 '16, 3:48 p.m.

Question was seen: 2,756 times

Last updated: Aug 09 '16, 7:42 a.m.

Confirmation Cancel Confirm