How to send notification for every 2 business days
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:10 AM
Hi ,
My requirement is to send notification for every 2 business days in change request.
Thnks in advance.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:35 AM
Hello sasikala,
You can do it by triggering an event to be processed in the future. For that you can use the eventQueueScheduled. Follow this steps:
- In change_request table, create a BR (to be triggered whenever you want) that will trigger the creation of an event to be executed in 2 days:
var dt = new GlideDateTime(); dt.addDays(2); gs.eventQueueScheduled("<name_of_your_event>", current, "", "", dt);
- Create a notification that will be triggered by your event
- Create a Script action (sysevent_script_action table) to be executed when <name_of_your_event> is executed. This script action should:
- Validate if your change_request is still open (or in a state where the reminder notifications are still needed). If so, trigger again the event to be executed in two days, by using the same code I provided before.
This will allow you to achieve the behavior you need.
If you consider this answer relevant for you, please mark it as helpful.
Thanks!
Filipe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:36 AM
Thanks you,
but i want to send only business days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 04:39 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2022 06:28 AM
Hi Sasikala,
If you want to do it by using scheduled jobs, you can put this in your scheduled job script field:
sendNotifications();
function sendNotification(){
var gr = new GlideRecord("change_request");
gr.addQuery(<insert your query here to pick the right change requests>);
gr.query();
while(gr.next()){
gs.eventQueue('<name_of_event>', gr, '', '');
}
}
Replace <name_of_event> by the name of the event you create for this.
Then, you trigger your notification based on the event.
if you need to pass information for your event, use the last two parameters of the eventQueue method.
Hope this helps!