It's all about the answers!

Ask a question

Attibute Customization for Calculated value get "status history" before save


HIROAKI JOSAKO (47427) | asked Feb 15 '16, 10:29 p.m.
Attibute Customization based on Script

I want to create a function to get the status at the time of storage and the status of the last of history.
Is it possible?


push Savebutton
1.history Status 1time ago
2.get saved Status last
3 diff status history Status and last Status

Accepted answer


permanent link
Ralph Schoon (63.2k33646) | answered Feb 16 '16, 2:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.
HIROAKI JOSAKO selected this answer as the correct answer

Comments
HIROAKI JOSAKO commented Feb 16 '16, 7:14 p.m.
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.

Ralph Schoon commented Feb 17 '16, 1:43 a.m. | edited Feb 17 '16, 1:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.

Your answer


Register or 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.