It's all about the answers!

Ask a question

where can I find the example that get a attribute's previous value and current value on the workitem?


chen fengmiao (7032731) | asked Apr 15 '14, 12:15 a.m.
edited Apr 15 '14, 2:52 a.m. by Ralph Schoon (59.7k23643)
Hi. I want to get a attribute's previous value and current value on the workitem. Where Can I find this example or API?Thank you!

2 answers



permanent link
sam detweiler (12.5k6184201) | answered Apr 15 '14, 12:20 a.m.
You cannot get its previous value except from the server side plugin in Java.
there is some data saved in history, but I haven't looked for a way to navigate the history.

Comments
chen fengmiao commented Apr 15 '14, 1:04 a.m.

In fact. I want to  realize this function that if one attribute's value changed, the 'category' attribute automatically change the value to 'Unassigne', How can I realize the function through the java plugin?


permanent link
Ralph Schoon (59.7k23643) | answered Apr 15 '14, 2:49 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Work Items are IAuditables and they have up to two 'predecessor states'. You can use the Java API to look at the predecessor state and compare the values e.g.of an attribute.

In a participant, you get the new state and (if exists) the old state of a work item. Thus you are able to compare the attribute value and act on it. See https://rsjazz.wordpress.com/?s=participant for examples. This would be a server extension.

Your answer


Register or to post your answer.