Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email notifications - status

RMendoza
Tera Expert

In ServiceNOW, is there a function to alert the manager via email if a task or item is open, unassigned, or have no activity beyond a certain number of days?  An email alert with a link directly to that task/item. 

1 REPLY 1

PoonkodiS
Tera Expert

you need “manager alert if a ticket is unassigned or stale for N days”, would implement the Scheduled-Job + Custom Event + Notification approach.

Scheduled Job:

var gr = new GlideRecord('incident');
gr.addQuery('assigned_to', ''); 
gr.addQuery('state', '!=', 'Resolved');  
gr.addQuery('sys_updated_on', '<=', gs.daysAgo(7)); 
gr.query();
while (gr.next()) {
gs.eventQueue('task.stale.unassigned', gr, gr.opened_by, gs.getUserID());
}

Create a Notification (via System Policy → Email → Notifications) to that event, and sends an email to relevant recipient(s), e.g. the manager

Body of the email include${number} of the record