
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 03:33 AM
Hi All,
I have a requirement to send an email notification on a certain day of the month. I am trying to achieve this through an event using a scheduled job.
This is what I have so far in Dev to test this -
Event
Scheduled job
Notification
I believe the issue is with the script for the scheduled job?
Or is there a different/easier way to achieve this?
Any help would be much appreciated.
Thanks,
Alex
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:07 AM
Okay. Then do it like this in your scheduled job.
var gr = new GlideRecord("incident");
gr.setLimit(1);
gr.query();
if(gr.next()) {
gs.eventQueue('patching_email',gr,gs.getUserName(),gs.getUserID());
}
Event/notification runs on a specific record. Since in your case, its just a static mail.. we just pass any 1 incident object. Hence using setLimit(1).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 03:50 AM
Thanks for your response.
I tried the 2nd code as it is not specific to any condition/query but it did not work, any further ideas?
Thanks again,
Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 03:46 AM
Hi Alex,
Few things
1. gr is not declared anywhere. Thats the 1st issue as others already pointed out.
2. in your notification you selected event param2 contains recipient. Technically to which user you want to send mail whenever this event is fired?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 03:53 AM
Hi,
Thanks for you response.
I would like to send the email to whoever is selected in the 'when to send' tab within the notification?
Any Ideas?
Thanks,
Alex

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 03:58 AM
Hi Alex,
I assume you meant recipient selected under who to receive tab.
In that case, you can uncheck Event2 param contains recipient checkbox.
And on that specific day What notification you are planning to send? Are you including any details about any incidents? Or is it just a static email that you send without any details of any incident?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2020 04:02 AM
Hi there,
It is just a static email.
Thanks!
Alex