Notifications

Cancel changes

Discard all changes?

If you Cancel/Approve/Reject a group approval for a record before it is set to Requested, the other group approvals for the same record are set to 'No Longer Required' when user clicks on Request Approval.

Description

If group approvals for a record are in a Not Requested state and one of those group approvals is cancelled, the remaining group approvals are set to No Longer Required on when the Request Approval UI action is clicked.

Steps to Reproduce

Import the attached workflow version.

Create a new change request of type Normal.

The change request now has a few group approvals created in the Not Requested state.

In list view, change the state of one of those group approvals to Cancelled.

Click the Request Approval UI action.

Note that instead of the remaining group approvals being set to the Requested state, all of the remaining approvals are set to No Longer Required.

Workaround

Modify the onExecute function in the Approval-Group activity definition script.

Replace the following lines:

if (approvals.length > 0) {
// In order to maintain the approval state if we revisit this approval activity
// we need to only request those approvals that are currently in a Not Requested state
var state = this.approvalUtils.getGroupApprovalStateById(approvals);
if(state && state != 'not requested') {

with:

if (approvals.length > 0) {
// In order to maintain the approval state if we revisit this approval activity
// we need to request only those approvals that are currently in a Not Requested state
var state = this._determineOverallState();
if(state && state != 'skipped') {