I have one table called 'Issues' has a field called 'due_date' having field type 'date' and another

Abhishek Kathe
Mega Guru

I have one table called 'Issues' has a field called 'due_date' having field type 'date' and another field called 'assigned_to' having 'reference' field type referes to 'sys_user' table, so I want to send an email to a person who is present in 'assigned_to' field one day before the 'due date'. 

1 ACCEPTED SOLUTION

Your scheduled job script would be like below:

var issueGr = new GlideRecord('u_issue');  // replace yourbtable name
issueGr.addEncodedQuery('due_dateONTomorrow@javascript:gs.beginningOfTomorrow()@javascript:gs.endOfTomorrow()');  // replace your due date field name
issueGr.query();
while(issueGr.next()){
gs.eventQueue('reminder.event_name',issueGr,'');  // add event name as per your configuration.
}

 

Check below links to learn more about event based notification.

https://www.youtube.com/watch?v=YSZFiumGXj4

https://www.youtube.com/watch?v=K4J9oay7Zwk

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

How to trigger an email notification through Event in ServiceNow | EventQueue | Explained with Scenario | ServiceNow Please Like, Share & Subscribe my channel if you find my video useful and do let me know your doubts or queries in comment section below. Instagram : servicenow_adda Gmail : ...
This video help you to understand: 1. What is Event in servicenow and where we can use them. 2. How to trigger email notification through event in servicenow. 3. How to test email notification triggered or not. Please visit below for servicenow development, servicenow administration and servicenow
3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Abhishek Kathe 

 

You can use the flow designer for this.

 

The good link 

https://www.servicenow.com/community/developer-forum/flow-designer-reminder-emails/m-p/2413189

 

https://www.servicenow.com/community/developer-forum/how-to-send-an-email-notiffication-to-assigned-...

 

 

https://www.servicenow.com/community/developer-forum/is-it-possible-to-create-a-notification-7-days-...

 

 

 

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

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

Anil Lande
Kilo Patron

You can use scheduled job and event based notifications.

In your script make a query to 'Issue' table and filter records where Due date is tomorrow.

For all records trigger event based notification.

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Your scheduled job script would be like below:

var issueGr = new GlideRecord('u_issue');  // replace yourbtable name
issueGr.addEncodedQuery('due_dateONTomorrow@javascript:gs.beginningOfTomorrow()@javascript:gs.endOfTomorrow()');  // replace your due date field name
issueGr.query();
while(issueGr.next()){
gs.eventQueue('reminder.event_name',issueGr,'');  // add event name as per your configuration.
}

 

Check below links to learn more about event based notification.

https://www.youtube.com/watch?v=YSZFiumGXj4

https://www.youtube.com/watch?v=K4J9oay7Zwk

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande
How to trigger an email notification through Event in ServiceNow | EventQueue | Explained with Scenario | ServiceNow Please Like, Share & Subscribe my channel if you find my video useful and do let me know your doubts or queries in comment section below. Instagram : servicenow_adda Gmail : ...
This video help you to understand: 1. What is Event in servicenow and where we can use them. 2. How to trigger email notification through event in servicenow. 3. How to test email notification triggered or not. Please visit below for servicenow development, servicenow administration and servicenow