Work Item customization: is it possible to use Work Item Status attribute as a depedency for triggering a Calculated Value Script?
Hello,
dojo.provide("com.company.alm.workitem.previousState"); dojo.require("com.ibm.team.workitem.api.common.WorkItemAttributes");
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! |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered May 09 '17, 10:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER 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. |
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.