Email - Inbound Action - Incident Closed

DK18
Kilo Contributor

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.

8 REPLIES 8

Giles Lewis
Giga Guru

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();
}
}

DK18
Kilo Contributor

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.

Giles Lewis
Giga Guru

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.

DK18
Kilo Contributor

I will try out your suggestion and come back with an update. Thanks for your inputs.