Notification upon Item Due Date expiration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2012 07:09 AM
We just recently went live with ServiceNow Aspen, so I'm new to this.
We have a need to notify the currently active teams when the Due date for an Request Item has expired.
The way we currently have it written it is based off of an update to the item. This causes an issue where the teams are continually notified after expiration because we have all task updates copy to the item OR not notified at actualy time of expiration but when a user finally updates the ticket.
What I'm looking for is a one time notification at time of expiration. I looked at SLA's but we are using workflows and the Due Dates are different for all our request types so a duration wouldn't work for us. The only other way I can think to do this write scheduled jobs that checks hourly for the expiration.
Has anyone else done something similar to this or does anyone else have any suggestions on how to send a notificaiton to the teams when the Due Date for the Item has expired?
Thanks!
Lara

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2012 07:45 AM
You could do this with a scheduled job that runs daily to check any overdue items. Here's a forum post of a similar question to get you started:
Notifications sent based on due date checked daily
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2012 01:37 PM
Thank you - Thats what I had been working on before I posted this, a scheduled job - my issue is that once a day is not enough. They want the email when the due date expires. Also they only want the email once - if I put that Due Date > Now or a specific time it will continue to send the reminder everytime the schedule job runs.
I was going to offer them a schedule job that runs hourly so it would catch expirations within the hour - having the schedule job run hourly - looking for anything that expired in the last hour. I just wasn't sure if there was a better way.
My scheduled job script would be
var gr = new GlideRecord( 'sc_req_item' );
gr.addQuery( 'active', 'true' );
gr.addQuery( 'due_date', '<', gs.hoursAgoStart(1) );
gr.addQuery( 'due_date', '>', gs.nowDateTime());
gr.query();
while( gr.next() ) {
gs.eventQueue( 'm.due.date.expire', current, current.sys_id, gs.getUserName() );
}