Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Trigger email when no incident created in last 30 min

Harsha Bharamb1
Tera Contributor
 
5 REPLIES 5

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());
}