Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Vinay52 

 

To simplify it, create the condition at the list view first and check if you are getting the changes or not.

AGLearnNGrow_0-1742209142886.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]

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

I am getting 1hr, 2hr ago Planned end date changes as well, Do you know how to achieve based on my requirement? Thanks 

Try from Now.

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

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

It wont work with From Now as well