Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Does anyone know why an attribute customization for calculated value would throw an error when trying to get the Resolution attribute?

 I have a script based calculated value attribute customization for the corrected estimate field that is marked as dependent on the Status, Resolution, and Time Spent fields.  The script retrieves the current value of the corrected estimate field along with the state, time spent, and type values.  It then does some checks based on type to see if we want to set the corrected estimate to 0.  For two of our types, we do a further check for the Closed state.  When closed, we check the Resolution field for specific values.


We have noticed that the server log contains a large number of errors from the Script Engine related to this attribute customization.  The error states: "Attempting to get unset feature: InternalResolution".

When I first encountered this, I realized my script was attempting to retrieve the Resolution attribute for every work item regardless of state.  I then moved the call to get the Resolution value inside the if block that checked type/state thinking maybe it was due to the fact that the Resolution attribute isn't accessible in every state.   We are still receiving the error.

Does anyone know why we might be getting the "Attempting to get unset feature" error?  I have tried querying in jazz.net, but had no luck.

My script is:
-----------------------------------
dojo.provide("com.gdc4s.rtc.ValueProvider.CorrectedEstimateZero");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
(function() {
var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;

    dojo.declare("com.gdc4s.rtc.ValueProvider.CorrectedEstimateZero", null, {

        getValue: function(attribute, workItem, configuration) {
          var cest = workItem.getValue(WorkItemAttributes.CORRECTED_ESTIMATE);
          var state = workItem.getValue(WorkItemAttributes.STATE);
          var tspent = workItem.getValue(WorkItemAttributes.TIME_SPENT);
          var rtype = workItem.getValue(WorkItemAttributes.TYPE);
 
          var zeroIt = 0;
 
          / Check to see if the type/state pairing is one we care about /
          /  Task ==> Invalid (.s4)  Problem/Enhancement ==> Closed (.s7) and Resolution not Fixed (r1 / 1) or Fixed Upstream (r8 / 8) /
          if ((rtype == "task") && (state == "4" || state.lastIndexOf("s4") > -1)) {
            zeroIt = 1;
          }
          if ((rtype == "defect" || rtype == "problem" || rtype == "enhancement") && (state.lastIndexOf("s7") > -1)) {
            var resolution = workItem.getValue(WorkItemAttributes.RESOLUTION);
            if (resolution != "r1" && resolution != "1" && resolution != "r8" && resolution != "8") {
              zeroIt = 1;
            }
          }
          if (zeroIt == 1) {
            if (tspent > 0)
            {
              cest = tspent;
            }
            else
            {
              cest = 0;
            }
          }
          
          return cest;
        }
    });
})();
--------------------------

Thank you,
Jamie.

0 votes


Be the first one to answer this question!

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jan 30 '17, 1:05 p.m.

Question was seen: 1,193 times

Last updated: Jan 30 '17, 1:05 p.m.

Confirmation Cancel Confirm