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; } }); })(); |
Accepted answer
is sequencecounter Double attribute by any chance, which means a Double value is being returned and if you are using this script for an Integer attribute, its likely that you get the error you are seeing...
Ralph Schoon selected this answer as the correct answer
Comments
Sachin Nairy
commented Sep 27 '12, 4:00 a.m.
Dear Dinesh,
|
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.