- 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 06:14 AM
You can use scheduled scripting as you have to check for the whole incident list and their responses from Customer, if the incident is waiting for Customer Updated, check the check box Customer Action Needed...
if you have got the response from Customer, uncheck the Customer Action needed.
In the scheduled script, write a script which runs every day morning and in that script you can send Notifications or Close the incident, both the actions can be taken care.
Creating a Scheduled Job - ServiceNow Wiki
There are some out of box Scheduled scripts which you can refer.
https://<instanceName>.service-now.com/sysauto_list.do?sysparm_query=sys_class_name%3Dsysauto_script
Mark if it is helpful or correct, feedback is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 06:52 AM
Hi Srikanth
We'd rather avoid having to ask the analysts to check and uncheck boxes - although I guess you could script this to happen automatically using a business rule. I'll take a look into scheduled jobs thanks
Shona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:24 AM
Hi Shona,
What I meant is the system has to do the checking and unchecking Customer Action needed check box. I am not asking for analysts to do it manually.
For example, I will tell the scenario:
On a particular incident, you have sent the notification to customer asking for response, usually this is done through business rule by firing gs.eventQueue()
In the same script, write a script to check the customer action needed checkbox and increment the timer that you have sent notification to customer.
It will look like -
gs.eventQueue('customer.response' , , , ) //respective parameters
current.customer_action_needed = true;
current.notification_timer += 1 //considering its default value is 0
Now you will go to scheduled job to write a scheduled script - which looks like the script shared by Travers, everyday morning it traverses the incident list
and checks for all the incident with customer_action_needed checkbox and checks the notification timer
For all the incidents with the customer_Action_needed checkbox checked and notification timer crossed 3 then immediately in the same script you will write to close the incident with necessary comments ( please use the script of Travers, its helpful)
But in between if customers responds the incident, then write a before Business rule to uncheck the customer_action_needed checkbox and reset the timer.
So when next day morning the job which tries to find out all the incidents which are pending response from customer, this incident will be skipped.
This is the usual automated process and no where some one has to manually check any checkbox, everything is taken care by Business rules and Scheduled scripting.
I hope my explanation is helpful. Sorry that you misunderstood, i failed to communicate properly before.
Mark if it is helpful or correct, feedback is appreicated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:53 AM
Hi Srikanth
Thanks for the clarification and sorry i misunderstood. It's good to get advice from everyone