Removing signature statement in inbound emails.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2017 03:13 PM
We have a standard signature that I would like to have removed to improved legibility in incidents. Reading this thread: https://community.servicenow.com/thread/180541 I see that it looks like we can do it in an inbound action. Is that right? The same inbound action that creates the incident? I created a system property...I'm just not sure how to modify our existing inbound action to strip it out...
Here is our current inbound action script:
// Note: current.opened_by is already set to the first UserID that matches the From: email address
current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.category = "inquiry";
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.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
}
if (email.body.priority != undefined)
current.priority = email.body.priority;
current.insert();
The system property I created is named:
becks.confidentiality.signature
I am really new at this ...trying to wrap my head around it...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2017 04:52 PM
I think the main challenge you will have with this is trying to identify the signature given that the body of an email if often changed and reformatted quite drastically by different systems. So changes in white-space are probably going to be an issue if you have a long signature.
Option 1 removes the signature if it finds an exact match. Option 2 will probably work better.
// Note: current.opened_by is already set to the first UserID that matches the From: email address
//Identify any Footer/Auto Signature standard text to be stripped from email.
var signature = gs.getProperty('becks.confidentiality.signature');
var body = String(email.body_text);
// Option 1 - Hope for an exact match
body = body.replace(signature, '');
// Option 2 - Trim everything after the signature
var startOfSignature = signature.substring(0, 40); // first few characters of the signature
var indexOfSignature = body.indexOf(startOfSignature);
if (indexOfSignature > -1)
body = body.substring(0, indexOfSignature); // trim everything from the signature
current.caller_id = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + body; // Update body here
current.short_description = email.subject;
current.category = "inquiry";
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.importance != undefined) {
if (email.importance.toLowerCase() == "high")
current.priority = 1;
}
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
06-12-2018 09:09 AM
may thanks this really helped me clear all for a mailto reply templated email, i included the watermark in the mailto email and used this for the property to keep the inbound action to set the work_note nice and cleanly.
For anyone else this is what i had:
.
which gave me this:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2017 04:56 PM
Although this is a viable method, if the format of your corporate signature is standardized....
Here's another common approach:
There's a property for reply seperators, and the system automatically discards text after the seperator. It's commonly used for stripping out signatures as well.
glide.pop3.reply_separators | Discard everything below this text if found in a reply body (comma separated, case sensitive) | Specifies the comma-separated list of separators that cause the instance to disregard everything below the text string in the message body. This list is case sensitive.
|

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2017 05:00 PM
Nice one. Yeah, I like that solution better.