- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2025 05:52 PM
On daily bases I want to send an notification to the manager of like what all incident open till the previous date.
Should I use a Scheduled Job, Workflow, or Notification to achieve this, and what would the best approach be for such a use case?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 10:24 PM
Hi @kusumgautam
There are multiple ways like :-
1. use flow designer --> choose trigger as scheduled job(run daily) --> add action send notification --> choose your notification with appropriate filter.
2. Use Schedule job script to trigger the Notification by Gliding to the table(incident) and Achieve it .
3. In workflow also you can use run script to glide to the table and fetch data and triiger notificvation using gs.eventQueue()
sample Script :-
(function executeScheduledJob() {
var x= new GlideRecord('incident');
x.addQuery('state', '!=', '7'); // Exclude closed incidents
x.addQuery('opened_at', '<', gs.daysAgoStart(1)); // Opened before yesterday
x.query();
var incidentList = [];
while (x.next()) {
incidentList.push(x.number + " - " + x.short_description);
}
if (incidentList.length > 0) {
gs.eventQueue("custom.incident.notification", null, "manager@example.com", incidentList.join("\n"));
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 10:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 10:24 PM
Hi @kusumgautam
There are multiple ways like :-
1. use flow designer --> choose trigger as scheduled job(run daily) --> add action send notification --> choose your notification with appropriate filter.
2. Use Schedule job script to trigger the Notification by Gliding to the table(incident) and Achieve it .
3. In workflow also you can use run script to glide to the table and fetch data and triiger notificvation using gs.eventQueue()
sample Script :-
(function executeScheduledJob() {
var x= new GlideRecord('incident');
x.addQuery('state', '!=', '7'); // Exclude closed incidents
x.addQuery('opened_at', '<', gs.daysAgoStart(1)); // Opened before yesterday
x.query();
var incidentList = [];
while (x.next()) {
incidentList.push(x.number + " - " + x.short_description);
}
if (incidentList.length > 0) {
gs.eventQueue("custom.incident.notification", null, "manager@example.com", incidentList.join("\n"));
}
})();