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 (915240) | 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.3k33646) | answered Jul 07 '19, 7:17 a.m.
edited Jul 07 '19, 7:17 a.m.
Note, it must be implemented in a follow up action/participant. As explained in 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.4k217) | 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 (915240) | 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:

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:

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.