Reply Email always change the State of Incident to 'In progress'

Kasia5
Tera Contributor

Hi All!

I have an issue with Inbound Action which cause that when user reply to the email notification related to resolution, then state of incident is always changed to 'In progress'

I want to change this Inbound action to change the state (reopen the incident) only when in subject there will be words like ,,reopen" etc.

Do you if it is possible? 

I've added the condition like below but it does not work:

// If inc-number found and not an auto reply execute below code
if (match != null && !autoReply && subject.indexOf("reopen") < -1 || subject.indexOf("öffnen") < -1 ) {
// gs.log('Number: ' + current.number + ' RegExResult: ' + match[0]);
if (current.number.toLowerCase() == match[0]) {
current.setValue('state', '2'); // "In Progress"

 

Thanks in advance for help!

1 REPLY 1

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

When I debug subject.indexOf("reopen"), this gives me a number higher than -1. Same for Ã¶ffnen. So I guess you should change < -1 into != -1 or > -1?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn