Inbound Action - If subject contains "Ticket ######" then abort

Jeff316
Kilo Guru

Hello Community,

I need help with a RegExp.

If the inbound email's subject contains the text "Ticket" followed by a space and any 6 digits then I want to abort the email from creating an incident.

Subject:RE: Ticket 123432 fix my computer

The text "Ticket ######" could appear anywhere in the subject line and it should abort.

Thanks for the help on this late Saturday night.

Jeff

1 ACCEPTED SOLUTION

Abhinay Erra
Giga Sage

Use this regular expression



if(/Ticket\s\d{6}/g.test(email.subject.toString())){


event.state="stop_processing";


}


View solution in original post

9 REPLIES 9

Abhinay Erra
Giga Sage

Use this regular expression



if(/Ticket\s\d{6}/g.test(email.subject.toString())){


event.state="stop_processing";


}


Thanks to all.


The script does identify the correct script and in the inbound email action log   the stop_processing command is received, however the incident still creates.


It must be something now that I'm doing wrong in the actions of the of the inbound email rule.


I wish I could apply this script on the "when to run" but using the regexp in the condition bar, I'm told does not work there.


Abhinay,



It looks like if I put your script, in an inbound email action all of it's own and place the order low, this appears to catch the inbound email and stops the incident from being created, but if it doesn't meet the condition in the script it passes this rule and let's the other rules fire that should create the incident.


Thanks for the help Abhinay, I appreciate it.


Have a nice week.


How to achieve this within an Inbound Email Action that has type set to "Forward," but does not want to process/create another ticket if the "Subject contains "RE:. ""