Attibute Customization for Calculated value get "status history" before save
Accepted answer
In attribute customization with JavaScript, you can only access the current status. It is not possible to access the status history. You can also only trigger on the change of an attribute. Only conditions can access the action to change the state and you can not use this information to store it.
What you can do, is to define an attribute where you store the last state and use this value and a calculated value based on the work item state, to determine that a state change has happened and what the old state was. I think it is pretty much a crutch and would rather consider to put complex behavior like that into a follow up action.
What you can do, is to define an attribute where you store the last state and use this value and a calculated value based on the work item state, to determine that a state change has happened and what the old state was. I think it is pretty much a crutch and would rather consider to put complex behavior like that into a follow up action.
Comments
It is not possible to get the history, we know that the purpose is not achieved. There is no technology to develop a "follow-up action". Unfortunately, I give up.
You can get the history in the Java API. I have no code for that, but the Eclipse client computes the history from the predecessor states of the work item.
You can actually create Java based follow up actions, where you can do a lot more than in the JavaScript attribute customization.
See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ for an introduction.