- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-04-2019 06:06 AM
I have a date field on incident form , I want to send a notification to assigned to person when that date is reached.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-04-2019 06:46 AM
Kindly refer to gs.eventQueueScheduled API which will help you to trigger the event at a required time. and you can configure the notification to listen to this event.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-04-2019 06:44 AM
you can create here scheduled job and validate if the date field matched with current date then execute the gs.eventQueue() to trigger your event based notification.
Create one Notification that will be trigger based on the event.
create on Event
Create on Scheduled job and add the below script , try to modify the few of the field name in script based on your need.
Sample Code:
var gr = new GlideRecord('incident');
gr.addActiveQuery();
gr.query();
while(gr.next()){
if(gr.<your date field Name> == gs.nowDateTime()){
gs.eventQueue('<your event name>',gr,gr.assigned_to.toString());
}
}
Refer the below doc for further details about the notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā08-19-2021 09:36 AM
Hi
Apologies for digging up an old thread but I am having some issues with the above script. I've amended it to try and get it to fire when the estimated_delivery field is not empty and less than the current time. However, it seems to be firing for every RITM in the system!!
My amended script is as follows:
var gr = new GlideRecord('sc_req_item');
gr.addActiveQuery();
gr.query();
while(gr.next()){
if(gr.estimated_delivery !== null || gr.estimated_delivery !== "" && (gr.estimated_delivery < gs.nowDateTime())){
gs.eventQueue('missed_delivery',gr,gr.assigned_to.toString());
}
}
Can anyone point me to where I have gone wrong?!
TIA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-04-2019 06:46 AM
Kindly refer to gs.eventQueueScheduled API which will help you to trigger the event at a required time. and you can configure the notification to listen to this event.