Caluculated Value Script fails in Server
Hello Team,
We have introduced new attribute wiki type and setting the value on save of workitem.
Script is follows:
dojo.provide("com.rtc.js.client.PdcWidgetScript");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.rtc.js.client.PdcWidgetScript", null, {
getValue: function(attribute, workItem, configuration) {
var workitemId = workItem.getValue(WorkItemAttributes.ID);
console.log('workitemid' + workitemId);
if(workitemId === -1)
return "";
else {
var hardcode = '{{https://xxxx.com/ccm/web/projects/Comp#action=com.ibm.team.dashboard.viewDashboard&tab=_10&story_id=';
var finalString = hardcode + workitemId + ' | Fill PDC }}';
return finalString;
}
});
})();
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
dojo.declare("com.rtc.js.client.PdcWidgetScript", null, {
getValue: function(attribute, workItem, configuration) {
var workitemId = workItem.getValue(WorkItemAttributes.ID);
console.log('workitemid' + workitemId);
if(workitemId === -1)
return "";
else {
var hardcode = '{{https://xxxx.com/ccm/web/projects/Comp#action=com.ibm.team.dashboard.viewDashboard&tab=_10&story_id=';
var finalString = hardcode + workitemId + ' | Fill PDC }}';
return finalString;
}
});
})();
After we rollout to Productive, we see value of Attribute is not set for some workitems.
When we take the same template back to Test environment, things are fine.
When i check the logs in the Productive, i see below failure and not sure what does it mean,
<Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0@10.3.47.52> /ccm/service/com.ibm.team.workitem.common.internal.rest.IWorkItemRestService/getWorkItemEditableProperties] [ERROR] com.ibm.team.workitem.common - Error invoking value provider 'PDCForWiki' associated with the attribute 'Initiate PDCLink' in the project area with id '_01T-QMPkEeSSPtPHKO0xfg'. You can link to the project area definition using a URL similar to https://thehostname:9443/jazz/process/project-areas/_01T-QMPkEeSSPtPHKO0xfg, where the host name, port and jazz context are configured for your installation. Contact your project area administrator for assistance.
java.lang.ArrayIndexOutOfBoundsException
at org.mozilla.javascript.NativeArray.get(NativeArray.java:324)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1603)
at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1361)
at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1345)
at org.mozilla.javascript.gen.c7._c52({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:901)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"})
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c7._c54({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:994)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"})
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c7._c56({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:998)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", ......
java.lang.ArrayIndexOutOfBoundsException
at org.mozilla.javascript.NativeArray.get(NativeArray.java:324)
at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1603)
at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1361)
at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1345)
at org.mozilla.javascript.gen.c7._c52({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:901)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"})
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c7._c54({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:994)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"})
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
at org.mozilla.javascript.gen.c7._c56({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", "name":"dojo.js"}:998)
at org.mozilla.javascript.gen.c7.call({"Bundle-SymbolicName":"org.dojotoolkit.dojo", "path":"resources", ......