Dealing with email replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2015 01:44 PM
We have an issue were INC are created for every replied to email, and is creating multiple tickets for the same issue. Our clients do not send emails strictly to ServiceNow but its redirected from a ServiceDesk Email account on Exchange. Our clients tend to use the ServideDesk Email account has a repository for all communication concerning IT related issues. They will open up a thread with multiple recipients when informing us of an issue, then all replies in such thread are creating on average about 5-10 duplicated tickets for this one instance. We want duplicated tickets from different users, this is allows us to know its effecting more than just one person.
After several failed attempts of scripts in side inbound email actions, I stumbled across business rules. This is my 3rd week working with ServiceNow so this may be a rudimentary fix, but I am unaware of a better. I don't want to ignore all emails whose subject starts with "RE:" because emails containing watermarks to update existing INC and re-opening a ticket after it was closed wouldn't function automatically as designed by the system.
Here is my solution:
Create New Business Rule -
table: Incident
when: before inserted
condition: when short description starts with "RE:"
action: Abort action
This simply prevented all emails starting with "RE" from being inserted into the INCIDENT table as new. If the watermark exists the system does not try to process this as a new insert but as an update so updating an existing ticket will process and function normally, same functionality for re-opening a ticket after is was closed when issue was not resolved properly.
Is this the most effective solution, or has anyone found a better?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 10:26 AM
Hi , Under System properties-->Email , you can set up reply or fwd filter values by updating subject prefixes. Have you tried that ? Apart from that, to capture something that is in the subject or body of the mail you can use below condition in Email -->Inbound Actions.
var subLc=email.subject.toLowerCase();
subLc.indexOf("<your txt>") >=0;
To make sure that the creation on incident only happens when its a new email, you could add a condition such as below in the beginning of create inbound action. the less than 0 means that these texts are not found.
if ((subLC.indexOf('re:') <0 ) || (subLC.indexOf('fwd:') < 0 ) || (subLC.indexOf('fw:') < 0 )){
<ENTER ALL CODE HERE>
}
You can use similar syntax to search something in the body of the mail.
email.body_text.toLowerCase().indexOf('<txt>') >=0
Have you tried the above ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 11:50 AM
System Properties is where I first started off, but that prevents any actions period. There were still replies that would come in that had the INC/REQ Reference ID that I wanted to still capture so it could populate ServiceNow with any notes from the users. As long as that ID was in the email body ServiceNow would recognize it and update the ticket. That's why I chose for the business rule to only abort on INSERT, so to not kill any updates that needed to be put in the system.
I have copied similar code from other inbound actions and tried to piece something together, but my programming skills are not up to that level to be able to construct anything useful. I would try to stop the process from the inbound action but I could only manage to stop all messages starting with RE: or accept them all. It would never update a ticket when I needed it to. Im still fairly new to ServiceNow, and to managing applications, I come from the infrastructure side of IT so learning the language and syntax is what im trying to understand now.
Im working on a few other tasks concerning Notifications and the creations of Request from Emails, but i'm curious now to see if I can make that business rule better. I will do some testing to see if I can get it to perform the abort only if a particular email address is within the body text.
Have you been working with ServiceNow long?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2016 12:59 PM
Hi Quentin,
We use "email.direct" to make sure only e-mails directly addressed to our ServiceNow instance (and some other shared mailboxes used by our Service Desk for intake) create an incident. Here's another community thread that describes this solution. So when someone mistakenly copies the instance address on an e-mail thread, none of the e-mails replies create incidents.
I hope this helps,
David
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2017 02:24 PM
I realize this is old post but I recently had to come up with a solution to also prevent reply to all emails from generating duplicate tickets. I was able to fix this by updating the Create Incident (type=new) inbound action.
I added a condition
Headers does not contain "In-Reply-To"
This works for us because it does not affect the OOB reply or forward inbound actions and is different from the BR because it ignores the email rather than generating a ticket (using up a number) then aborting it.
Just wanted to let you know how I got around the whole "reply to all" issue. This does not address the fact that you actually do want to associate some of the emails if from a different caller but it was the correct solution for us.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2018 10:27 AM
This is an old thread, but I'm running into the same problem. However, in this scenario we do not want to simply block the duplicate ticket from being created but actually update the comments on the existing one. Is this possible?