Reply and Forward Inbound email actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 09:25 AM
I would like to write a single inbound email action for the following three scenarios.
1. Reply email (Obviously has watermark)
2. Forward email with watermark
3. Forward email without watermark
By default, inbound emails of the Forward type always generate new incidents regardless of the presence of a watermark. So, I have changed the recognized reply and forward prefixes to treat forwards like replies and sorted out the forwards and replies by using a script.
The scenario 1 and 2 are working fine with the script but for the 3rd scenario, "Create Incident" is processed instead of my inbound email action. Please help me resolve the issue.
if((String(email.subject).indexOf('Fwd:') > -1) || (String(email.subject).indexOf('Fw:') > -1))
{
if(String(email.body_text).indexOf('Ref:MSG') > -1)
{
// forward email with watermark
current.update();
}
}
else if(String(email.body_text).indexOf('Ref:MSG') == -1)
{
// forward email without watermark
current.insert();
}
}
else
{
// reply email
current.update();
}
}
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-21-2015 09:53 AM
Hi Karthik,
Does the "Create Incident" have a higher Order than your Inbound Action?
Do you set event.state="stop_processing"; in your Inbound Action to prevent any other actions from running after yours?
Also, remember the flow for how ServiceNow determines which type of Action to run for a given inbound email:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2015 08:48 AM
Thanks Cory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2022 11:49 PM
@karthikdoure Can you please share the complete code how you executed this functionality ?
1. Reply email (Obviously has watermark)
2. Forward email with watermark
3. Forward email without watermark
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2023 11:49 AM
@karthikdoure how did you achieve this inbound action? How did you catch the forwarded email, query, and update the current active incident?