Need help - Sent notifications every 5 days until the approver responds to the request or the ticket is closed.

Tina24
Giga Guru

I am really need of some expert suggestions.

User want to have notifications for the current assigned approver(s) of requests sent every 5 days until the approver responds to the request or the ticket is closed.

Workflow:

find_real_file.png

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi,

Please find the steps below to achieve your requirement:

1) Navigate to "Registry" module and create a event as below:

2) Select table as sysapproval_approver as shown below:

find_real_file.png

3) Navigate to the module "Scheduled Job" under System Definition and select Automatically run a script and use the script below:

Script for reference:

sendNotif();

function sendNotif(){
	var gr = new GlideRecord('sysapproval_approver');
	gr.addEncodedQuery('state=requested^sys_created_onRELATIVELT@dayofweek@ahead@5^source_table=sc_req_item'); // Replace "sc_req_item" with the Table for which you want to trigger notification
	gr.query();
	while(gr.next()){
		gs.eventQueue('send.notif',gr,gr.approver); // "send.notif is the Event name configured in step 1. Also, "gr.approver" replace it with the recipient to whom you want to trigger.
	}
}

 

Scheduled Job Frequency:

find_real_file.png

Now finally configure your notification and make sure to make it event based and check the parameter "parm1 and send to event creator as tru as shown below:

Notification will be on Approval table:

find_real_file.png

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

7 REPLIES 7

Thameem Ansari
Giga Guru
Giga Guru

Hi Tina,

 

Refer to the below article:

Approval Reminder 

 

Now the above article is common to approvals from all the tables. so for the Trigger Condition you need to add some additional conditions so that it will be triggered only to your sc_request or sc_req_item table. 

find_real_file.png

In the above screenshot, I have set the trigger to run only for the sc_request and sc_req_item table. you can configure it as per your need.

Please mark it as Correct/Helpful If my answer is helpful in any way,

Best regards,

Thameem

Hi Thameem,

 

Thanks for your suggestion, how to set it send notification every 5 days?

"User want to have notifications for the current assigned approver(s) of requests sent every 5 days until the approver responds to the request or the ticket is closed."

find_real_file.png

Hi Tina please refer the below link . the link contains detailed steps for how to send it. 

 

https://community.servicenow.com/community?id=community_article&sys_id=1fe969a71b9c1010fff162c4bd4bc...


Please mark it as Correct/Helpful If my answer is helpful in any way,

Best regards,

Thameem

 

vkachineni
Kilo Sage
Kilo Sage

You can run a scheduled job every 5 days that looks at the approvals that are in a requested state for open tickets and send notifications.

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022