- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 06:08 AM
Hi,
We have a policy with our customers that after a period of time with no response to their incident we will also close the incident and I'm trying to determine how we can implement this feature in servicenow.
Can I do everything through an email notification or will I have to build on 2 separate applications, like notifications and business rules for example?
Our current model is also set to autoclose incidents after 3 days if they were in a resolved state using system properties.
So firstly, we want to send an email notification to our users if there has been no response via email or case comment after say 2 days
Secondly we then want to change the state of the incident to closed (or resolved) afterwards
Appreciate any advice given to assist me here
Thanks
Shona
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 07:05 AM
We use a method of auto closing incidents that are left in a custom need more information status for 7 days. If a ticket is updated by anyone within that period, it resets the timer. Below is the script that is used for that
var inc = new GlideRecord('incident');
inc.addQuery('state', '10');
inc.addQuery('sys_updated_on', '<=', gs.daysAgo(7));
inc.query();
while(inc.next()) {
gs.eventQueue("nmi.closure", inc, inc.caller_id, gs.getUserName());
inc.comments = 'Incident automatically closed after ' + 7 + ' days in a Need More Information status';
inc.close_code = '5b07efae0f99a9007b0b918172050e3c'; // Unknown
inc.close_notes = "Closed due to no reply.";
inc.state = 7;
inc.active = false;
inc.update();
}
From there, we have an email notification set up on the nmi.closure event with the details as to why their incident was closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 07:42 AM
We have a line in our inbound action to change the status
if (current.state == 10){ current.state = 2; }
I think for the portal/self service view we have something in place that updates that status but I'd have to dig for it as I'm not sure offhand and it was set up a long time ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:03 AM
Thanks Travers
The other thing I need to look at is if we have attempted to contact the customer on 3 separate occasions and have received no response then we would close the incident (this may be over any period of days) and I think will be slightly trickier to script around but thanks for your help so far.
Finally if I can ask a newbie question, where are you running your script - is it a client side or business rule - my guess would be business rule
Thanks
Shona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:58 AM
That script is a scheduled job set to run daily at 7:30 a.m.