Customizing calculated value but get NaN as result
![]()
Hi, I'm trying to get a calculated value on a custom attribute, this attribute is an integer type, and is also integer kind on presentation. I want it to count each time it reaches to an specific state. I'm using the following script:
dojo.provide("counterString");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes"); (function() { var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes; dojo.declare("counterString", null, { getValue: function(attributeId, workItem, configuration) { var counter = parseInt(workItem.getValue("counterString")); console.log("Counter: " + counter + "\n\n"); var stat = workItem.getValue(WorkItemAttributes.STATE); console.log(counter); console.log(stat); if(stat === "s5") { console.log("Actual value:" + counter); counter = counter+1; console.log("New Value:" + counter); } return parseInt(counter); } }); })();
The state condition works fine, but not for the counter, when I check my log it says "Counter: NaN".
What should I change on my script?
|