Is it possible to retrigger approval for only rejected approver

MohammedYaseen
Tera Expert

Hi All,

I have a requirement in a Service catalog where all approver in the approval group has to approve. If one approver rejects, it should not end the work flow. How to retrigger approval for the rejected approver. The rejection reason could be the variables in the catalog form has to change.

 

Thanks

1 ACCEPTED SOLUTION

Rajdeep Ganguly
Mega Guru


To implement this requirement in ServiceNow, you can follow these steps:

1. Create a custom workflow for the catalog item.
2. In the workflow, use the 'Approval - Group' activity to assign the approval to a group.
3. Set the 'If anyone rejects' field to 'Ignore' in the 'Approval - Group' activity. This will ensure that the workflow does not end if one approver rejects.
4. Add a script to the 'Rejected' condition of the 'Approval - Group' activity. This script should retrigger the approval for the rejected approver.
5. To retrigger the approval, you can use the 'Approval - User' activity and assign it to the rejected approver.
6. To change the variables in the catalog form based on the rejection reason, you can use the 'Run Script' activity in the workflow. This script should update the variables based on the rejection reason.

Here is a sample script for the 'Rejected' condition:

javascript
var approval = new GlideRecord('sysapproval_approver');
approval.addQuery('state', 'rejected');
approval.addQuery('source_table', 'sc_req_item');
approval.addQuery('source_id', current.sys_id);
approval.query();
while (approval.next()) {
// Retrigger approval for the rejected approver
var retriggerApproval = new GlideRecord('sysapproval_approver');
retriggerApproval.initialize();
retriggerApproval.state = 'requested';
retriggerApproval.source_table = 'sc_req_item';
retriggerApproval.source_id = current.sys_id;
retriggerApproval.approver = approval.approver;
retriggerApproval.insert();

// Update variables based on the rejection reason
var variables = new GlideRecord('sc_item_option_mtom');
variables.addQuery('request_item', current.sys_id);
variables.query();
while (variables.next()) {
// Update the variables as per your requirement
}
}


Please note that this is a sample script and you may need to modify it as per your requirement.


nowKB.com

For asking ServiceNow-related questions try this :
For a better and more optimistic result, please visit this website. It uses a Chat Generative Pre-Trained Transformer ( GPT ) technology for solving ServiceNow-related issues.
Link - https://nowgpt.ai/

For the ServiceNow Certified System Administrator exams try this :
https://www.udemy.com/course/servicenow-csa-admin-certification-exam-2023/?couponCode=NOW-DEVELOPER

View solution in original post

5 REPLIES 5

Hi @MohammedYaseen 

 

Please accept the answer as solution and close the thread.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************