Change Request Notifications to Change Implementer

Vinay52
Tera Expert

Hello All,

I am trying to create a ServiceNow Notification to Change Assignee

Requirement is - When the Planned End Date is more than 24Hrs and Change Request is still not closed then a notification to be sent to Change Assignee to close the change request as its overdue. Then Reminder notification to be sent after 48Hrs if still not closed. I would like to filter change requests based on state so that it does not generate trigger draft changes. 

I tried using the below condition but its not working, Any idea what wrong with the below filter conditions? Thank you 

 

Note: To test the notifications set at 5min

Vinay52_0-1742208560551.png

 

 

1 ACCEPTED SOLUTION

Vinay52
Tera Expert
I was able to create schedule job and make it work, Thank you Ashish
var gr = new GlideRecord('change_request');
var dateTime = new GlideDateTime();
dateTime.addDays(-1);
gr.addQuery('end_date', '<', dateTime);
gr.addQuery('state', 'IN', '2,3');
gr.query();
while (gr.next()) {
    // For each record that matches, trigger a notification
    gs.eventQueue('change.request.reminder', gr, gr.sys_id, gs.getUserID());
}
Then use notification event to trigger emails 

View solution in original post

9 REPLIES 9

Try:

AGLearnNGrow_0-1742210848598.png

 

 

*************************************************************************************************************
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]

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

AshishKM
Kilo Patron
Kilo Patron

Hi @Vinay52 ,

You need to write a schedule job, to keep checking the pre 24 hours and post 48 hour duration and trigger the email notification for all CHG fall under the condition. The schedule job script will glide over change_request table and compare the Planned End Date with current date, the hour different should be within 24 to 48 hour for pre notification.

 

-Thanks,

AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

Thanks Ashish, Let me try, I guess its not possible with Notification Filter conditions, right? How about Flow Designer option? 

Vinay52
Tera Expert
I was able to create schedule job and make it work, Thank you Ashish
var gr = new GlideRecord('change_request');
var dateTime = new GlideDateTime();
dateTime.addDays(-1);
gr.addQuery('end_date', '<', dateTime);
gr.addQuery('state', 'IN', '2,3');
gr.query();
while (gr.next()) {
    // For each record that matches, trigger a notification
    gs.eventQueue('change.request.reminder', gr, gr.sys_id, gs.getUserID());
}
Then use notification event to trigger emails 

Good to see that, my reply work for you. Please mark as accepted solution, you can select more than one answers. - Thanks.

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution