It's all about the answers!

Ask a question

Discarding/Reversing Work Item State Changes


SEC Servizi (97123660) | asked Feb 16 '18, 8:14 a.m.

Since you can discard or reverse change sets, we wonder if it is possible to discard/revert work-item state changes too. Maybe an internal admin function, even invocable only through API, e.g. from History Provider?

Thanks in advance.
Cheers.

2 answers



permanent link
SEC Servizi (97123660) | answered Feb 19 '18, 8:53 a.m.
IWorkItem  exposes a method  setState2(Identifier value)  which could be used to directly set the workflow state of a work item. However, this method is deprecated. The reason to deprecate it is most likely related to the fact that directly setting the workflow state of a work item does not respect the workflow. Essentially it would be possible to set a workflow state that is not even reachable from the current workflow state. 
luckily that's exacting what we need to create a custom client extension to discard/reverse work-item state changes.
Thank you all.
Cheers.

permanent link
Ralph Schoon (63.1k33646) | answered Feb 18 '18, 2:57 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No.

And if you really think about it, the concepts don't match either. The changeset does not go away at all.


Comments
SEC Servizi commented Feb 19 '18, 6:29 a.m. | edited Feb 19 '18, 8:04 a.m.
Obviously, discarding/reversing change sets was just a naïve example to try to explain what we would be able to obtain: we have some users who would to undo last work-item state change (e.g., made for mistake) and that's not possible but maybe there is some admin internal APIs we are not aware of to undo last "transaction" of work-item state change...
Thanks in advance.
Cheers.

Ralph Schoon commented Feb 19 '18, 6:50 a.m. | edited Feb 19 '18, 6:51 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No, not that I am aware of. You could programmatically iterate the history of the work item to get the values and set them using the API (if the process supports it). And state changes are problematic as the reverse action night not even be available.


Ralph Schoon commented Feb 19 '18, 6:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The API to just set a state is deprecated and since it does not use an action, it also gets unnoticed by all the process advisors.


SEC Servizi commented Feb 19 '18, 7:55 a.m. | edited Feb 19 '18, 7:56 a.m.
The API to just set a state is deprecated and since it does not use an action, it also gets unnoticed by all the process advisors. 
That's could be a useful tricky, thank you! Which is the Java API method you are referring to?
Thanks in advance.
Cheers.

Ralph Schoon commented Feb 19 '18, 8:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

SEC Servizi commented Feb 19 '18, 8:50 a.m.
setState2(Identifier value)
That's working, thank you!
showing 5 of 6 show 1 more comments

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.