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

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

0 votes



2 answers

Permanent link
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..

0 votes

Comments

workItem.getValue(attribute-ID get the current value, not the original value


Permanent link
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.

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
× 12,020

Question asked: Mar 11 '16, 9:48 a.m.

Question was seen: 3,003 times

Last updated: Apr 25 '16, 9:41 p.m.

Confirmation Cancel Confirm