Recognizing the Original Sender of a Forwarded email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 11:49 AM
So i'm using my free dev instance and working on starting 'tickets' (cases) from an email. I've got the inbound email action working for one sent from an email, so there's no issue there. The issue i'm having is dealing with the forwarded email. I've created the inbound email action (forwarded email) and got it to populate a my Submitted By field from the forwarded email. One I can't get to work is when the email has been forwarded more than once to get the user information from the original email.
This line works for the email only being forwarded once:
current.submitted_by = email.body.from.split("<")[0];
I would greatly appreciate any help with configuring it to pull the user from the original email for situations (though highly unlikely) where the email has been forwarded an additional x number of times before getting to the servicenow instance.
-
Joe
- Labels:
-
Personal Developer Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2018 04:13 PM
I've never seen this issue in the incident app and I think they just use 'email.origemail' there to identify the original sender regardless. Have you tried that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2018 05:09 AM
Mark,
I was trying to use that by placing the orgemail:
current.submitted_by = email.orgemail.body.from.split("<")[0];
and
current.submitted_by = email.body.orgemail.from.split("<")[0];
Neither worked; it sent the emails to the general Incident module within ServiceNow and still didn't populate the field correctly, in fact it left the field blank.
Note: Just to clarify the last part of the line (split.("<")[0]; it is there to so it doesn't pull the email in the signature block that is hyperlinked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2018 08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2018 08:37 AM
So...
using
current.submitted_by = email.origemail.from;
sends to the correct location but does not populate the submitted by field
using
current.submitted_by = email.origemail;
sends it to the generic incidents section and doesn't populate the correct field
using
current.submitted_by = email.origemail.from.split("<")[0];
sends to the generic incidents section and doesn't populate the correct field