- 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
09-30-2015 10:28 AM
Thank you Michael!
This is great! Do I just create a new Inbound Email Action for this?
I'll let you know how are tests go. If you're ever in Seattle I owe you a big stein of beer!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2015 10:57 AM
Best practice is to not edit the out of the box code. So you should inactivate the existing "Create Incident" inbound email action and create a new one with the above code as it is using the out of the box code IF the old ticket number is not found in the email subject.
Please make sure you edit the "numberPattern" value to meet your numbering scheme. Hopefully my comment makes sense to know what to change. If not post here and I will try to help. I will need some example ticket numbers to help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2015 09:22 AM
I'm having trouble getting this to kick in.
Here are some details (the bold one is your script with just field reference and pattern fixed):
|
What difference does the order make on these? Do I need to make any Reply or Forward references in "Email" to make this work? Currently I have the new Create Incident Associated with "New" emails.
Thanks again for all your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2015 09:23 AM
For some reason the orders didn't come through above. They are 5, 10, 5 respectively...But I don't think that matters as long as they are prior to other other actions...correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2015 09:43 AM
The "Reply/Forward" references shouldn't make a difference. Just to make sure I took a random email in my inbox and clicked reply and then changed the To to my ServiceNow instance to see what would happen. The Create Incident inbound email action processed it.
The order comes in where the inbound email actions are processed lowest to highest. The following Wiki article explains how this works:
http://wiki.servicenow.com/index.php?title=Ordered_Email_Processing#gsc.tab=0