Calculated value script error in RTC “Error invoking value provider”
![]() Hi All, I am using RTC customization feature of calculated value. But am getting below issue, please help me to resolve this issue. Error invoking value provider 'com.ibm.team.workitem.valueproviders.VALUE_PROVIDER._hNvRkAfAEeKEUK6W_Xcz2A' java.lang.ClassCastException: java.lang.Integer incompatible with java.lang.Double.
Attributes :
1. counter : Type : Integer
2. Sequence : Type : Integer
Script: Generating counter value : this script is working fine. dojo.provide("counter"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("counter", null, { getValue: function(attributeId, workItem, configuration) { var count = workItem.getValue("counter"); var stat = workItem.getValue(WorkItemAttributes.STATE); if(stat === "ChangeRequestWorkFlow.state.s1") { count = 0; } else count = 1; return count; } }); })()
Generating sequence number using work item status and counter value This script giving issue. dojo.provide("sequence");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("sequence", null, { getValue: function(attributeId, workItem, configuration) { var seq = workItem.getValue("sequencecounter"); var count = workItem.getValue("counter"); var stat = (workItem.getValue(WorkItemAttributes.STATE)); if(stat === "ChangeRequestWorkFlow.state.s1" && count === 1) seq = (seq+1); return seq; } }); })(); |