It's all about the answers!

Ask a question

CLM 6.0.2: Calculated Value - Cannot load the script class


Heather Linsk (1422352) | asked Aug 08 '16, 3:48 p.m.
edited Aug 08 '16, 3:52 p.m.
 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 ;
}   
    });
})();

Accepted answer


permanent link
Heather Linsk (1422352) | answered Aug 08 '16, 4:15 p.m.
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

Comments
Ralph Schoon commented Aug 09 '16, 2:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Heather Linsk commented Aug 09 '16, 7:42 a.m.

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

Your answer


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