Create new INCIDENT if email is sent to Closed ticket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 10:16 AM
REQ - We have seen an uptick in frustrated users not getting a response because they are responding to emails to tickets that are in a closed state. Seems like there is no NDR or auto-reply to say that the incident has not been updated because the ticket is closed.
Please can we either have a new Incident created if an email is sent to a Closed ticket.
I have written code but it is not working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 07:12 PM
Hello @Raj12341,
For similar kind of requirement, please refer to the link below:
https://www.servicenow.com/community/itsm-forum/email-inbound-action-incident-closed/m-p/784395
Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 07:51 PM - edited 12-20-2023 07:54 PM
Hi @Raj12341
You can try the below script to create a new incident when an Inbound Reply to a Closed Incident.
if (current.active == false) {
var grINC = new GlideRecord('incident');
grINC.initialize();
grINC.caller_id = gs.getUserID() || current.caller_id; //current user or caller from closed inc
grINC.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
grINC.short_description = email.subject;
grINC.category = "request";
grINC.incident_state = IncidentState.NEW;
grINC.notify = 2;
grINC.contact_type = "email";
grINC.assigned_to = (email.body.assign != undefined) ? email.body.assign : current.assigned_to;
if (email.importance != undefined) {
if (email.importance.toLowerCase() == "high") {
grINC.impact = 1;
grINC.urgency = 1;
}
} else {
grINC.impact = current.impact;
grINC.urgency = current.urgency;
}
var notes = "A new Incident created due to an email is sent to a Closed ticket: [code]<a href='incident.do?sys_id=" + current.sys_id + "' > " + current.number + "</a>[/code]";
grINC.work_notes = notes;
grINC.insert();
}
Cheers,
Tai Vu