It's all about the answers!

Ask a question

Revert approvals status to pending state when work items in RTC are re-opened


Bharath Rao (90034) | asked Jul 07 '19, 1:27 a.m.
We have a requirement where in we need to set the Approval Status, Approved to Pending when the state of work item is set back to Deferred state i.e If the state is change from Analyzed to Deferred, we need to reset the Approvals filed as Pending.
Can this be achieved using dojo script ?

3 answers



permanent link
Ralph Schoon (63.1k33645) | answered Jul 07 '19, 7:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Jul 07 '19, 7:17 a.m.
Note, it must be implemented in a follow up action/participant. As explained in https://rsjazz.wordpress.com/2012/12/14/do-not-modify-the-triggering-element-in-an-operationadvisor/ an advisor/precondition must not modify the triggering element.

To "Reset" the approval state, iterate all approvals, remove the aprovers, then add the approvers again. That resets the approvers approval state and the cumulative state.

Note: The code always runs in the context of the user doing the work item state change. So for this to work, every rol that can change the work item state and trigger the participant, must be able to modify the approval.

permanent link
Davyd Norris (2.2k217) | answered Jul 07 '19, 7:25 p.m.
I personally would not do it this way - I would create a second approval instead.

If you roll the existing approvals back then you lose the history of who approved or who didn't and why - by creating a second round approval you get to see both in context.

This would also require no automation extensions - just a process change

permanent link
Bharath Rao (90034) | answered Jul 07 '19, 1:28 a.m.
edited Jul 07 '19, 1:28 a.m.

There is no out of the box option for the requirement in RTC.


Regarding the customization, this cannot be achieved using dojo script based operations advisor as there is no way to access the work item Approvals from the script.

The below article has the list of work item attributes that can be accessed via the dojo script:

https://jazz.net/wiki/bin/view/Main/AttributeCustomization#Accessing_built_in_attributes_of


However, you could try to develop a java based operations advisor using PlainJavaClientLibraries to perform the below steps:

a. Get the Approvers list when the work item is reopened

b. Delete and Create Approvals for the Approvers with the Initial (pending) state on work item save


For more details you could review the below link:

https://jazz.net/library/article/1118

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.