Issue
Group Approval is set to 'Approved', when one of its approval records are in 'Approved' state while using "new WorkflowApprovalUtils().cancelAll(gr);" API
However, all the approval records are being set to 'Cancelled'
Release
NewYork
Resolution
To fix the issue, the following changes needs to be made as mentioned in the steps below:
1. Open script include WorkflowApprovalUtils
2. In method setAllApprovalsByTask (line 38)
swap both lines as below:
setAllApprovalsByTask: function(/*GlideRecord*/ target, approvalState, /*optional*/ comment) {
this.setUserApprovalsByTask(target.sys_id, approvalState, comment, []);
this.setGroupApprovalsByTask(target.sys_id, approvalState, comment, []);
},
3. Save the record