It's all about the answers!

Ask a question

Why does my script run only once in calculated values?


German Ortega (131) | asked Jan 26 '17, 1:17 p.m.

dojo.provide("com.calculated.testingIteration");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
    dojo.declare("com.calculated.testingIteration", null, {

        getValue: function(attribute, workItem, configuration) {

          var state = workItem.getLabel(WorkItemAttributes.STATE);
          var count = workItem.getValue(attribute);
          if(state == "Development") {
               return 3;
          } else {
               return 2;
           }
       }
    });
})();

I wrote a calculated value script that returns 3 if the state = "Development" or else return 2 otherwise. I'm expecting the attribute to change to 2 when the state changes but it looks like it only reads the script when I refresh the page. This worked development testing but when moved to production it stopped working and I'm not sure why. Can someone help?

One answer



permanent link
Donald Nong (14.5k414) | answered Jan 29 '17, 11:29 p.m.

Showing your script will not get you the answer. You need to understand how the Calculated Value script is triggered - it was clearly stated in the document.
https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Script_based_calculated_values

A similar question (probably more) was asked in the past.
https://jazz.net/forum/questions/202887/rtc-calculated-value-triggering-for-any-change-in-status-or-attribute

Your answer


Register or to post 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.