How to update Approval policy with dynamic ad-hoc group approvals?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2023 02:58 AM - edited 04-26-2023 05:29 AM
Hi, newby here, so pls bear with me if I'm asking nosense or missing something.
I am updating change management module from old non-model and workflow state to new model and flows.
In old non-model version, in any change request we had an option to add ad-hoc approval groups to the approval flow.
(lets say, for certain change, I believe group B also should review/approve the change request). These ad-hoc groups were 100% ad-hoc (anyone can click 'add group' -> select any group -> get it into approval flow).
But now, with flows and approval policies, I'm struggling to replicate this scenario.
Is there any option to update the change approval policy from flows?
so far, the closest I've been is to place "ask for approval" right before "apply change approval policy", but that releases the approvals in two stages (first 'ask for approval' record, and once it is approved triggers the approval policy), this is delaying the entire approval flow.
And it becomes even slower if I for example have 3 additional approvers:
1st ad-hoc approval is triggered --> once it is approved -->2nd ad-hoc approval is triggered --> once it is approved --> 3rd ad-hoc approval is triggered --> once it is approved --> aproval policy is applied.
or
triggering them in two stages (ad-hoc and approval policy). First stage is done followig "Scripted Approvals in Flow Designer with Flow Variables " guide, but I must say that I'm failing miserably to get it working for more than 1 ad-hoc group. Considering an unknown amount of ad-hoc groups, how could the ruleset be to ensure 1approver for every group approves and if any approver from any group rejects the whole approvals are rejected?
Is there any way to dynamically add approval records to a current approval policy, so all of them can be triggered in paralel?
Kind regards and thanks in advance for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2023 05:00 AM
Hi @JCR ,
Yes, it is possible to update an approval policy with dynamic ad-hoc group approvals in ServiceNow. Here are the steps to follow:
Create a variable set that includes a multi-row variable for the ad-hoc group approvals. This variable should include fields for the group name, the approver, and any additional information you want to capture.
In the flow designer, add a "Create Approval Record" action after the "Apply Change Approval Policy" action. Configure the approval record to use the dynamic ad-hoc group approvals variable set.
Use a loop to iterate through each ad-hoc group in the variable set and create an approval record for each group. You can use the "Update Record" action to update the approval record with the correct group and approver.
Once all the ad-hoc approvals have been created, use the "Wait for Condition" action to wait for all approvals to be completed. You can use a script to check if all approvals have been completed, and if so, continue with the rest of the flow.
If any of the ad-hoc approvals are rejected, use the "Cancel Approval Record" action to cancel the approval record and stop the flow.
This approach allows you to dynamically add ad-hoc group approvals to the approval policy and trigger them in parallel, without delaying the entire approval flow.
If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the ✅Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.
Thank you!
Ratnakar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 12:15 AM
Hi @Ratnakar7 , it would be helpful if you could share some screenshots of the same. I am working on similar requirement and looking for some help on the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2024 12:16 AM
@Ratnakar7 ,however my case here is to use the workflow editor instead of flow designer.