How to get a RTC attribute original Value in Calculated Values javascript
Hello All, I want to add a text log field B to log the value of Field A. That is the current value of Field A + original value of Field B. How can I get the original value of Field B? Also I want get the current state of the work item, tried a few ways, it did not work. Your help would be greatly appreciated. Jay Cheng |
2 answers
the calculated value script looks like this
dojo.provide("com.example.ValueProvider"); (function() { dojo.declare("com.example.ValueProvider", null, { getValue: function(attribute, workItem, configuration) { return workItem.getValue(attribute-ID); } }); })(); so, if you want some other attributes value you would workItem.getValue(attribute-ID); note this is NOT the 'name' of the attribute, but its ID.. Comments
jay cheng
commented Apr 22 '16, 10:46 a.m.
workItem.getValue(attribute-ID get the current value, not the original value |
Based on previous discussions, you can't do it that way.
https://jazz.net/forum/questions/121485/can-i-get-the-previous-value-of-an-attribute-during-a-validator https://jazz.net/forum/questions/148607/where-can-i-find-the-example-that-get-a-attributes-previous-value-and-current-value-on-the-workitem If you have to do it using JavaScript, you may consider adding a hidden attribute containing the history of the attribute of interest. |
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.