Error when trying to implement a Default Value script
![]()
Hi
We are using RTC 5.0
I am trying to implement a Default Value into the Estimate Attribute based on a selected value in a Custom Attribute field ,ie,
If the value selected in the custom attribute field = Medium Enhancement, then the Estimate Field should default to a value of 60 Hours.
I used the following script;
dojo.provide("com.example.estimatedTime");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes= com.ibm.team.workitem.api.common.WorkItemAttributes;
var estimatedTime= dojo.declare("com.example.estimatedTime", null, {
getDefaultValue: function(attribute, workitem, configuration) {
var estimatedTime = parseFloat(workitem.getLabel(String "service_Classification"));
if estimatedTime === "service_Classification.literal.l6"); {
return "30";
}
else if estimatedTime === "service_Classification.literal.l13"); {
return "60";
}
else if estimatedTime === "service_Classification.literal.l8"); {
return "90" ;
}
}
});
})();
I am getting the following error;
2016-04-23 16:11:30,753 [ccm: AsynchronousTaskRunner-2 @@ 16:11] ERROR com.ibm.team.workitem.common - Error invoking value provider 'com.ibm.team.workitem.valueproviders.VALUE_PROVIDER._uLJToAlaEeauvdaUeukNjg'
com.ibm.team.rtc.common.scriptengine.UnknownTypeException: 'com.example.estimatedTime' is not a constructor
Any and all assistance will be greatly appreciated.
Kind Regards
Glenn
|