Trigger email when no incident created in last 30 min
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2024 12:57 AM
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-03-2024 03:23 AM
Hello Prashant,
I have used below mentioned condition in scheduled job:
var incident = new GlideRecord('incident');
incident.addEncodedQuery('active=true^sys_created_onRELATIVEGT@minute@ago@30');
incident.query();
// If no incidents were created in the last 45 minutes, send an email
if (!incidentTable.hasNext()) {
gs.eventQueue("email.send",incidentTable,gs.getUserID(), gs.getUserName());
}