Setting duration for Approval.

arnabdash
Mega Contributor

Hi Guys,

I have a requirement in which an approver is given 48 hrs to approve a request. If he fails to do so a notification is sent out to him and the timer is reset. This process of "48 hrs->notification->reset" continues until the approver approves the request.

I am new to ServiceNow workflows. Please help me with a direction to achieve this.

1 ACCEPTED SOLUTION

Create a new event on sysapproval_approver table and have a related reminder notification. Check event 1 param as recipient check box on the notification.



Use a script like below in the scheduled job and modify as per your need



var queryString = "state=requested^sys_created_on<javascript:gs.daysAgoStart(2)";


var gr = new GlideRecord('sysapproval_approver');


gr.addEncodedQuery(queryString);


gr.query();


while (gr.next()) {


    gs.eventQueue('custom_reminder_event',gr,gr.approver);


}


View solution in original post

3 REPLIES 3

Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Arnab,



I would do a reminder scheduled job that resends approval notifications rather than trying to do something through the workflow.



Approval Reminder Emails


Hi Brad,



Thank you for your response. I went through the proposed idea. Could you please suggest how to implement my requirements using scheduled job?



My requirement needs the approver to get the mails if he fails to approve in 48 hrs. After that I am required to wait for another 48 hrs and email again.


This will continue until he approves it.



How can I achieve this using scheduler?



Thanks,


Arnab


Create a new event on sysapproval_approver table and have a related reminder notification. Check event 1 param as recipient check box on the notification.



Use a script like below in the scheduled job and modify as per your need



var queryString = "state=requested^sys_created_on<javascript:gs.daysAgoStart(2)";


var gr = new GlideRecord('sysapproval_approver');


gr.addEncodedQuery(queryString);


gr.query();


while (gr.next()) {


    gs.eventQueue('custom_reminder_event',gr,gr.approver);


}