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

How can I get the old state and new state use javascript in calculated value

 How can I get the old state and new state use javascript in calculated value?

0 votes



One answer

Permanent link
Hi Haizi,

the answer as of my knowledge today is, you can only access the current state value. See: https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of . There is no way to know the state or the action that ran. There is no trivial way to detect a state change in java script I am aware of.

By the way, this question has been asked and answered in this forum several times in the past already. Answers should be relatively easy to find using a search engine or the forum or site search.

0 votes

Comments

It is still not possible to get the ID of the old state. However, in 4.x you can access the action that was used in conditions. See https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript

since 4.0 M1 getWorkflowAction() returns a string that is the id of a workflow action currently selected by the user. This action will be executed when the item is saved. If the user has not selected any action this method will return null . Note: This method works only when used inside a Condition script, the return value will always be null when this is used in other customization script types.


1 vote

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,941

Question asked: Nov 21 '12, 4:59 a.m.

Question was seen: 5,857 times

Last updated: Mar 21 '13, 12:28 p.m.

Confirmation Cancel Confirm