Incidents created from forwarded emails not setting original sender as Caller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 08:21 AM
We're having an issue with inbound emails, specifically forwarded emails, not creating incidents with the original sender as the Caller. Here's an example from our Dev instance:
I received an email from Jason Sears, who is a registered and active user in ServiceNow. I forwarded this email to our Dev instance's default mailbox. Here's what the incident record looks like:
As you can see, it created with me as the Caller. Looking at the email logs, I see this:
It's clearly identifying the email as a forward and getting processed by the correct Inbound Action, but I'm wondering if my issue doesn't have something to do with the first highlighted box where it mentions not searching for a From:. The Inbound Action for 'Create Incident (Forwarded)' is the default action, but I can post the script if necessary. Can anyone shed some light on why it's not correctly matching the original sender to a user? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 08:56 AM
Can you also try:
current.caller_id = email.body.from;
if that doesn't work (sorry for all the testing), let's do this:
-Comment out any caller_id assignment you have
-use
current.email = email.origemail;
So the theory is that the caller field is a reference to the sys_user table and since the email will now be populated in the email field, perhaps the Caller ID will self-populate based off the dot-walk from the email.
Worth a shot?
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 09:01 AM
I'm giving these a shot now, thanks for your help! I'll let you know how it looks with those changes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 09:08 AM
Allen,
I made the first change you suggested and the Caller is now blank. I got the same result with the second change as well. Here's my current script, just in case I didn't apply either suggestion correctly:
// Note: current.opened_by is already set to the first UserID that matches the From: email address
//current.caller_id = gs.getUserID();
//current.caller_id = email.origemail;
//current.caller_id = email.body.from;
current.email = email.origemail;
current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.category = "request";
current.incident_state = IncidentState.NEW;
current.notify = 2;
current.contact_type = "email";
if (email.body.assign != undefined)
current.assigned_to = email.body.assign;
if (email.body.priority != undefined)
current.priority = email.body.priority;
current.insert();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 09:13 AM
Yea, see my post below about ensuring that the inbound action type is actually set to Forward. It sounds like that may be the issue here.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 08:59 AM
Allen's comment got me thinking:
Here's the first section of the inbound rule with Allen's suggestion:
//current.caller_id = gs.getUserID();
current.caller_id = email.origemail;
current.comments = "forwarded by: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
Looking at the incident records that are being created, they show this:
This leads me to think that there's some reason that the email.origemail function isn't grabbing the correct email for some reason. This particular email was sent to me from jsears and forwarded into ServiceNow, however it's showing me as the original sender.