- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2017 05:16 AM
Hi All,
I need some help in scripting.
There is an inbound email to servicenow that contains INC# in the subject line but no prefix- Re: , FW: etc..
So as per the rules, it will be considered as a New Incident to be created.
But since there is incident number in the subject line , I want to update the incident in the subject line .It can update in the cmments field.
So script would require:
1. Fetching the Incident number from the subject line.
2. Compare in the Incidents table if that INC# already exists , then update the incident comments with the body of email.
3. If the number in subject line does not exist ,create a new incident.
Please help in scripting.
Note: Thisis a condition were no prefixes are present. in case prefix is there, it updates already.So I am not looking for that
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 07:19 PM
Have a look here: Inbound Actions - need to find INC number and 3rd party ref
I had the same need as you (fetch case number from subject line - without a RE: or FW:) and that helped me getting on the right track!
Let us know how you go and if you need more help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 04:48 AM
Hi
You need to create a new inbound action and put it in the stack ahead of the other cases.
1. Take a copy of the "update incident" that comes OOTB and rename it to Incident Update v2 (or something)
2. Change the Type to "New" or "None" - so it doesn't action when the prefix one does
3. Set the Stop processing flag so that if it runs it doesn't run again and create a new ticket as well.
4, Change order to 30 - so it runs before all the other Update or New
5. Change the condition filter for the Subject starts with INC
The actions tab should stay the same.
The only reason this won't work is if the validator fails .. which includes things like the MSG number and sys_id.
But try it and if it works .. then you don't need to worry about that.
Cheers,
Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2017 05:16 AM
Thanks for detailed explanation.
This will stop processing for all the emails with INC in the subject line.
But if the incident is already present in the system, I want to compare with incident table- if it exists- update, else stop processing

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 07:33 PM
Hey Neetika,
Looks like it's a OOB functianility of service now,
ServiceNow recognizes this subject line as a reply and recognizes the INC prefix as belonging to the incident table. ServiceNow searches the incident table for an existing record INC0005574. If this incident exists, the email is associated with this incident. If this incident record does not exist, ServiceNow uses the inbound action for new emails to create a new incident, and associates the new incident with the email.
Please check this Inbound Email Actions - ServiceNow Wiki for more details.
what do you mean by else stop processing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 07:19 PM
Have a look here: Inbound Actions - need to find INC number and 3rd party ref
I had the same need as you (fetch case number from subject line - without a RE: or FW:) and that helped me getting on the right track!
Let us know how you go and if you need more help.