- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2015 02:13 PM
We are migrating over to SN from a previous ticketing system. Part of the migration will involve tickets that are already open in the old system, and clients will be expecting to still be able to reply to the old ticket subject lines for those tickets and get a response. I can get emails to update existing incidents in our service now dev instance if I include the SN incident number format in the subject line, so moving forward it should be fine, however for those other tickets that we will be importing in that include the old format of ticket numbers (does not have "INC" in the ticket format) is there a way we can script our inbound email actions for incident updates to check on a different style of ticket number format?
Best regards,
Brian
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2015 03:06 PM
Many organizations choose not to import ticket data from the old system, but obviously in some cases that may be required. If you need to do this, you could create a custom field with the old ticket number, or even prefix the short description with it. Then your inbound email script could do a query in whatever field you choose to match that ticket number. First you could need to parse the email subject for the old ticket number, then use that in your query to find the existing incident created. I hope this makes sense.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2015 02:00 PM
Okay. Figured it out with a lot of help from ServiceNow support.
The field was being populated with: 123456
But it was trying to match from the form in the reply: ##123456##
Adding an additional variable that removed the ## preceding and following the 123456 fixed our issue.
Thank you so much Michael!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2015 03:13 PM
Glad to hear you got it working. The additional variable is one solution but you can also change the Regex pattern as well. I had included the #'s based on your earlier notes.
var numberPattern = "/[0-9]{5}/";
So the pattern above is looking for 5 consecutive numbers with digits 0-9. If the old ticket numbers are 6 digits then change the {5} to {6} as an example.
Have a nice weekend.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2015 03:51 PM
I still owe you a beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2016 08:53 PM
This seems to be exactly what I've been looking for...
Thank you for posting this; I'm sure many others will find it helpful as well.
I have a couple of questions:
The bottom line here is that the solution needed to address the lack of a watermark or ServiceNow record number, since we're catching these non-watermarked records in the
create inbound actions, I"m assuming we won't have to adjust the system property below to include a keyword for 'reply to'.
The reason I ask this is for our requirements, we will have a 3rd party that sends emails to us and will have to match to existing Incident based on the customer's ticket number (which will be stored on the Incident OR Request record) for us to match on.
It seems as though this should work for our purposes, but does this make sense Michael?
1 - We have an Inbound action that is using the Cart API to create a service request; I'm assuming the script that you have here should work (the matching part) if I run it prior to the cart api function?
2 - For Incidents, I can just update the 'create' Incident Inbound email action with the script you've provided
3 - I'm thinking I won't have to adjust the system property below since we're catching these in the 'create' Inbound actions?
glide.email.reply_subject_prefix | Specifies the list of prefixes (comma-separated) in the subject line that identify an email reply.
|
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2016 05:06 AM
Josh, you shouldn't have to update the system property you mentioned, unless your 3rd party uses some strange prefix that isn't listed in the system property. That is just a list of prefixes that email clients add to the beginning of an email subject when a user clicks the reply button and the inbound email actions leverage that to know whether the email is new or a reply.
Based on your description of what you are trying to accomplish, this is similar to Ewan's requirement of emails coming in from old tickets. So your solution is just a matter of modifying the code to query for your 3rd party ticket number field for a match.