How add only comment without old notification via mail handler when I answer html notification?

aas January 10, 2020

Hello everybody. When I try to comment issue answering email notification in text format everything is ok , but if I get notification from Jira in html format and answer on it to comment issue, I get a lot of unwanted information such as old notification and From: , Sent:, To:, Subject:  in comment. 

In config StripQuotes is true, but I suppose it works only for text format notifications. What can I do with html format notifications?

Will be glad to any help.

2 answers

1 accepted

0 votes
aas January 12, 2020

I use custom email handler plugin which check StripQuotes parameter in config file and if it's true, then 

NonQuotedCommentHandler nq = new NonQuotedCommentHandler();                    
nq.init(params, messageHandlerErrorCollector);
nq.handleMessage(message, messageHandlerContext);

if StripQuotes = false, then

FullCommentHandler fc = new FullCommentHandler();
fc.init(params, messageHandlerErrorCollector);
fc.handleMessage(message, messageHandlerContext);

As I understand, NonQuotedCommentHandler will strip any quoted lines from the email (ie lines that start with > or |) so text message have old information lines starts with > and that info doesn't add as a comment, but html format message doesn't and so all unwanted information adds as a comment. How can I fix this? May be there some class like NonQuotedCommentHandler where I can tune necessary lines, or I can change html template where I can add ---- Original Message ---- line and then NonQuotedCommentHandler class will not add everything below that line?  

Suggest an answer

Log in or Sign up to answer