Remove original message text from a comment added by e-mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2012 02:44 AM
So when a user logs a call they get an e-mail with the incident details e.g.
---------------------------------------------
From: IT Service Desk [mailto:servicedesk@mycompany.com]
Sent: 25 May 2012 09:51
To: aUser
Subject: Incident INC0010178 -- opened on your behalf
Short description: Test 0949 25/05/12
Click here to view: INC0010178
----------------------------------------------------
If they reply to that e-mail it adds a comment to the incident. The comment includes everything in the e-mail e.g.
------------------------------------------------------
reply from: aUser@mycompany.com
"the user's comment"
From: IT Service Desk [mailto:servicedesk@mycompany.com]
Sent: 25 May 2012 09:51
To: aUser
Subject: Incident INC0010178 -- opened on your behalf
Short description: Test 0949 25/05/12
Click here to view: INC0010178
--------------------------------------------------------
I'm only interested in the info they've added in their reply not the whole e-mail conversation. Is there a way I can strip the original message text from the comment? For example the comment will always contain their reply then the original mesage which will be "From:servicedesk@mycompany.com". Can I run a rule to strip the text after "From:servicedesk@mycompany.com"?
Thanks
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-25-2012 04:53 AM
You should be able to do this by setting the 'For reply emails, discard everything below this text if found in message body (comma separated list, case sensitive): ' property under 'System Properties -> Email'. The key is finding a consistent string that provides the separation between the new content and the rest of the email thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2014 07:01 AM
Anyone have experience trying to work replies from Gmail or Google Groups?
Our SN instance sends out emails. And users reply to them. The body shows something like you see below. I tried adding '
DEV - TT Service Desk <tradingtechdev@service-now.com> wrote:' but didn't work.
***
attempt #3
On Thu, Sep 25, 2014 at 6:36 PM, DEV - TT Service Desk <
tradingtechdev@service-now.com> wrote:
> SUBMITTED: A TT (Next-gen platform) incident has been marked submitted.
>
> User: Service Deployment-Script -
> joanne.wilson+svc_deployment@tradingtechnologies.com
> See the Activity Journal (under the Notes tab) for full Crash Detected
> email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2015 10:09 PM
hi Joanne,
I'm also facing similiar issue? Wat is the solution you find for this issue?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2015 01:36 PM
I ended up using the regular expression pattern below:
var replypattern = /On (.|\n)*wrote:/;
The script looks for the first occurrance of that pattern and marks the index value (variable idx)
var idx = email.body_text.search(replypattern);
I then cut off anything after that index with:
var shortbody;
if (idx > 0) {
shortbody = email.body_text.substring(0,idx);
} else {
shortbody = email.body_text;
}
The contents of the var shortbody is used to update the incident (Work Note or Comment).
Please note that the script's use normal javascript regular expression caused us a huge problem when we patched from Eureka Patch 1 to Patch 7. Somewhere between that, there were SN regular expression engine changes. And converting to the recommended SNC.Regex was giving us issues. So, we ended having to set a system property to use the old regex engine for our instance.
I need to take some time to try the new SNC.Regex class again for this use case.