Email Reminder before 1 hour of Plan End Date in Change Request.

Aakanksha Kotti
Tera Contributor

Hi Team,

We have a requirement where we have to sent out email notification to the assignee & assignment group of the change request before 1 hour of the 'Planned End Date'. For ex: if the planned end date is 26th August 2023 at 5 pm, an email notification should be triggered at 4 pm as a reminder to the assignee & assignment group.

Kindly let me know how to achieve this.

Thank you for your time on this

1 REPLY 1

SoniaShridhar13
Giga Guru

Hi @Aakanksha Kotti  you can try with below code and modify the script in your scheduled job as below and give it a try-

var gr = new GlideRecord('change_request');  

 

gr.addActiveQuery('active', 'true');   //It will fetch all Active Records

 

gr.addEncodedQuery('start_dateRELATIVEGT@hour@ahead@1');   /It will decide that the Planned Start Date is after One hour

 

gr.query();  

 

while(gr.next()) {  

 

gs.eventQueue("change.due", gr, "", "");  

 

}  



I hope this helps.Please mark correct/helpful based on impact.

 

Thanks,

Sonia