- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-16-2017 04:56 PM
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
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2017 04:28 PM
Use this regular expression
if(/Ticket\s\d{6}/g.test(email.subject.toString())){
event.state="stop_processing";
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2017 04:28 PM
Use this regular expression
if(/Ticket\s\d{6}/g.test(email.subject.toString())){
event.state="stop_processing";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 04:52 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 05:16 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 06:59 AM
Thanks for the help Abhinay, I appreciate it.
Have a nice week.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2024 10:07 AM
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:. ""