- 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"));
}
})();
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2025 10:51 AM
Hi @kusumgautam
This will be helpful solution
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- 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"));
}
})();
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/