How can I filter incoming email to only add the latest comment to an Incident?

ben_kahn
Kilo Expert

Hi,

 

I've noticed that when an Incident is updated via email, the activity feed quickly becomes very clogged and hard to read - when customers reply via email, the comment that is added contains the entire body of the email that they are replying to. This leads to very long comments that contain a lot of duplicated text. Is there an easy way to filter incoming messages so that only the customer's response is added to the Comments section of the Incident? I'm thinking I could use a <HR></HR> tag or something similar and include a "Don't write below this line" message in the outbound notification email, and then filter out everything below that in the inbound mail, but am unsure how to go about setting that up. I think initially our email config was done by the previous administrator with help from our implementation partner so I really don't have much insight as to how that works.

 

Thanks!

1 ACCEPTED SOLUTION

ben_kahn
Kilo Expert

Thanks for the suggestions and help everyone. I ended up using the method outlined here:



http://glassputan.wordpress.com/2012/03/08/managing-email-replies/



It seems to be working great in my DEV instance, will push it live today.


View solution in original post

16 REPLIES 16

Wow Ben, that worked awesomely.


Working great in my production instance as well. I must admit I don't entirely understand how it works - I get the Javascript manipulating the strings, but not exactly sure what it's finding. My instance appends a "reply from:", not just a "from:" to each comment added, and it still works exactly as you'd want it to.


Your "reply from:" is in regards to the user who's mailing in, but this script works by looking for the first of the trailing messages: "From: YourCompany Help Desk <mailto:url@service-now.com>" so your instance is searching for it's own email name, it goes back 6 characters (F R O M:_) and chops everything off from there.


Thanks Alan,



That makes more sense - I was assuming that gs.getProperty("glide.email.username") would return the name of the person responding via email, not the name of the person (or entity) that sent the email which is being responded to.


Yes, gs.getProperty("glide.email.username") is the name that the instance itself goes by in regards to email.   So it's looking for it's own name/email address (which is only going to be found at the top of the 2nd email).