- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:34 PM
i created a record today now after the 4 days i have to send notification how i can do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:04 AM
Sorry for the confusion, please check this script:
I assume Schedule job will execute once a day and it will check all the records of a table
var days = 4;
var date = new GlideDateTime();
date.addDaysUTC(-days);
gs.info(date); // this will give 23/11/2023
var gr = new GlideRecord("incident");
gr.addQuery("sys_created_on" ,"<", date);
gr.query();
while(gr.next()){
gs.eventQUeue("TestEvent",gr);
}
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2023 11:39 PM - edited 11-26-2023 11:40 PM
without specific information it's hard to give a specific reply, however one easy solution would be to use a flow to monitor for records in your table that are active, have created on (before) 4 days ago, and / or have updated on (before) 4 days ago - and if so - send an email or trigger a notification. Have it run at whatever interval suits you best.
Including updated on field will prevent notifications going out for records that are being actively worked on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 12:59 AM
i want to do with scheduled job so i need script for that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 01:38 AM
1) Create a event for example: TestEvent
2) Create a new notification and add trigger condition when even is fired
3) You can create a schedule job and mention below code in it:
var days = 4;
var date = new GlideDateTime();
date.addDaysUTC(days);
var gr = new GlideRecord("NAME_OF_THE_TABLE");
gr.addQuery("sys_updated_on" ,"=", date);
gr.query();
while(gr.next()){
gs.eventQueue("TestEvent",gr);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 01:47 AM
gr.addQuery("sys_updated_on" ,"=", date);
how this can be equal i want to send notification after 4 days the record created