- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 06:45 AM
I have a Scheduled Script Execution with this script:
var grCase = new GlideRecord("sn_customerservice_case");
grCase.addQuery("state", "18");
grCase.addQuery("u_on_hold_reason", "1");
grCase.addQuery("sys_updated_on", "<=", gs.daysAgo(4));
grCase.query();
while (grCase.next()) {
//Sent email if las updated
var gdt = new GlideDateTime(grCase.getValue("sys_updated_on"));
var gdt4 = new GlideDateTime(gs.daysAgo(4));
if (gdt.getDate().toString() == gdt4.getDate().toString()) {
gs.eventQueue("sn_customerservice.case.information.request.reminder", grCase);
}
}
I also have an email notification created to send whenever the event is fired with no other conditions:
The idea is that a notification is sent when a case has not been updated for 4 days and its status is On hold and on hold reason is Awaiting info.
My problem is that the email notification is not being triggered and I have checked all these things:
1-. The email notification and the Scheduled Script are active.
2-. There isn't other conditions in the notification (image attached).
3-. I have check the sys_email logs and the notification isn't there.
4-. I check the script and I have a case that meet the conditions (And I know that the event is fired).
Any ideas of what can I do to get that notification been sent?
Thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 07:23 AM
Hi,
Check whether you notification has proper sender emails configured.
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 07:04 AM
you are not setting the recipient
Ensure Event parm1 contains recipient checkbox is true in email notification
I assume event and notification both are on sn_customerservice_case table
var grCase = new GlideRecord("sn_customerservice_case");
grCase.addQuery("state", "18");
grCase.addQuery("u_on_hold_reason", "1");
grCase.addQuery("sys_updated_on", "<=", gs.daysAgo(4));
grCase.query();
while (grCase.next()) {
//Sent email if las updated
var gdt = new GlideDateTime(grCase.getValue("sys_updated_on"));
var gdt4 = new GlideDateTime(gs.daysAgo(4));
if (gdt.getDate().toString() == gdt4.getDate().toString()) {
gs.eventQueue("sn_customerservice.case.information.request.reminder", grCase, grCase.assigned_to);
}
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 07:16 AM
Hi @Alex Sastre,
If event are triggering the validate the following.
1. Make sure in your event and notification are on same table.
2. Make sure in your notification when to send is selected as event is fired and correct event is selected there
3. Make sure if recipients are present in your notification, if not then you can send it via parm1 when your event is fired from your script.
4. Make sure if recipients have valid email address.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Thanks
Vijay Balotia

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 07:23 AM
Hi,
Check whether you notification has proper sender emails configured.
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2023 07:39 AM
Thank you very much, it turned out that the fields I had set were empty in the case itself -.-