Change Approval Policy: Ensure Assigned To cannot approve if they are part of the CAB approval group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
We have a requirement to ensure that if the "Assigned To" user of a change_request is a member of the CAB approval group, that they should not be listed as an approver for the change. We use Change Approval Policies today to handle all the logic/approval requests/etc.
Is there an OOTB way for us to implement this requirement?
Is there a way to script the "Answer" of a change policy decision, so we can check for this condition and remove the user from the Approvers list?
I'd love to avoid customizing the Flow, but that seems like to be our likely path unless the above questions can be answered.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @ZackSmart
Since the OOB Change Approval Policy flow should not be modified, one option is to handle this when the approval record is created.
Create a before insert Business Rule on sysapproval_approver. If the approval is for a Change Request and the approver is also the assigned_to user, mark the approval as No Longer Required.
Example:
(function executeRule(current, previous) {
if (current.getValue('state') !== 'requested') {
return;
}
var changeGR = new GlideRecord('change_request');
if (!changeGR.get(current.getValue('sysapproval'))) {
return;
}
if (changeGR.getValue('assigned_to') !== current.getValue('approver')) {
return;
}
current.setValue('state', 'not_required');
current.setValue(
'comments',
'Approval marked No Longer Required because the approver is the Assigned to user on the Change Request.'
);
})(current, previous);
Suggested Business Rule configuration:
- Table: Approval [sysapproval_approver]
- When: Before
- Insert: True
- Update: False
- Advanced: True
I would test this carefully with the approval policy configuration, particularly where the rule requires all approvers rather than any one approver.
Please mark the response as Helpful or Accept as Solution if it assists.