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

Work Item customization: is it possible to use Work Item Status attribute as a depedency for triggering a Calculated Value Script?

Hello,
I'm creating a script to store the previous work item state in a custom attribute. The goal is to use this attribute to prevent users from changing the state of an interrupted work item to something other than its previous state. My code so far is quite simple:

dojo.provide("com.company.alm.workitem.previousState");
dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");

(function() {

   var WorkItemAttributes = com.ibm.team.workitem.api.common.WorkItemAttributes;
   dojo.declare("com.company.alm.workitem.previousState", null, {
      getValue: function(attributeId, workItem, configuration) {
         var prevState = workItem.getLabel(WorkItemAttributes.STATE);
         return prevState;
      }
   });
})();

The issue I'm facing happens when I configure the previous state custom attribute to use the work item Status as the dependency. Nothing happens. I can change the work item state as many times as I want, but the previous state custom attribute won't change. Now if I change the dependecy to some other work item attribute, such as Description or Owner, the script works fine and stores the work item current state.
I tried using the work item Modified attribute, but it didn't work either. Is my script missing anything? Or using the work item Status as a dependency is not supported?
BTW I'm running RTC 5.0.2 iFix019.

Thanks!

0 votes



One answer

Permanent link

 Not as far as I can tell. The state changes AFTER the save. You can use it as a dependency, but I think it would not trigger anything. The action selected by the user is only exposed to conditions (as explained in the documentation). This makes it pretty impossible to detect state changes. You can store the previous state in a hidden attribute, but that ALSO only works as dependency after the save has actually happened. 

0 votes

Your answer

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
× 10,926
× 34

Question asked: May 09 '17, 10:04 a.m.

Question was seen: 2,725 times

Last updated: May 09 '17, 10:47 a.m.

Confirmation Cancel Confirm