Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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 ?

0 votes



3 answers

Permanent link
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.

1 vote


Permanent link
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

1 vote


Permanent link

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

0 votes

Your answer

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

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 1,221

Question asked: Jul 07 '19, 1:27 a.m.

Question was seen: 2,468 times

Last updated: Jul 07 '19, 7:25 p.m.

Confirmation Cancel Confirm