Email - Inbound Action - Incident Closed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2019 01:05 PM
Hello,
I'm looking for options to manage emails on incident tickets that have been already closed. We had few instances of customers replying to old incidents that are closed long back with a new or related issue, the email is appended to the Closed ticket and was completely ignored.
Ideally, we would want a new ticket to be created if the incident is closed, or atleast have the incident reopened that can get the required notification.
Please let me know how this can be done.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2019 06:50 AM
Try the following
if (current.getTableName() == "incident") {
// 2 = In Progress
// 6 = Resolved
// 7 = Closed
if (current.state == 6 || current.state == 7) {
current.comments = 'User replied to a Closed incident. Ticket will be reopened.');
current.state = 2;
current.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2019 03:54 PM
Thanks Giles. I tried your script, still not changes.
The email is added to the ticket, however, not the comment in the script and the state doesn't change.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 06:58 AM
You should add some gs.log statements to the script to ensure that it is running the code as expected. You should also check the system log to ensure that the script is not throwing a javascript error.
In your field actions you are setting Additional comments from the email body. You are setting this same field in the script. I am not sure which runs first: the field actions or the script; but if you are setting the comments from two places then one will overwrite the other.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2019 01:22 PM
I will try out your suggestion and come back with an update. Thanks for your inputs.