Inbound email action, capture only latest reply

Anurag Tripathi
Mega Patron
Mega Patron

Hi Members,

I have an inbound email action that simply captures the response (replies only) and whatever comes in the email copy it to the ticket's comments. But if that email becomes a chain, multiple replies, the whole chain gets updated each time. That can be avoided if there is a way to capture the latest response in the incoming email.

Has anyone done this?? or any ideas??

-Anurag
1 ACCEPTED SOLUTION

sach1
Tera Guru

Never tried this but i think the approach for this would be to take only the content from the email where "From" starts with senders name. Found similar query on stack overflow.Below is the link:



javamail - Reading only the latest replied content using java mail multipart MIME - Stack Overflow




http://stackoverflow.com/questions/16984235/parsing-reply-email-to-take-only-the-latest-part


View solution in original post

8 REPLIES 8

I use email.body.variable to search for variable: [Value] in the email response. I am looking to utilize this on the messageContent, only the top reply in email, but have not found a way to do this. I've also tried messageContent.body but I assume its just a text and not something with the functionality that email.body had.



Is there an alternative way to accomplish this? Ultimately my issue is sometimes those key words linger in email response body from emails back and still are seen and utilized by the inbound action even if it was several emails ago.


You are right when you say that its just a text and you will not get the value of email.body.variable directly. you might need to do it through string functions. My bit got resolved after just extracting the most current reply so i did not dig deeper but i would love to see if you find a good to achieve this.


-Anurag

@Anurag

 

Where we have to update the above code ??

ceulert
Giga Contributor

Since Quebec, you have the Email Reply Separator table and the sys_properties glide.pop3.reply_separators is deprecated.

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/notification/task/pars...