JIRA- Create or Comment Issue Handler with Regex filter on the reply/forward message operation?

wajdhaikal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2012

I need to stop this behaviour when a user replies to an email notification to add a comment, there is no need to copy all old message body to the new comment, I'm trying o use Regex Comment Handler to do so, but I can not use it with create or comment issue handler, I need both create and comment!

Regex should be able o create new issues not only comment, is there any solution?

4 answers

1 accepted

0 votes
Answer accepted
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2012

If your only requirement is to strip content 'replied to', then the default create or comment handler should allow you to do so. See the 'Strip Quotes' reference is on http://confluence.atlassian.com/display/JIRA/Creating+Issues+and+Comments+from+Email

wajdhaikal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 9, 2012

And we need to make sure that the (outlook-email.translations) file found at:

Atlassian\JIRA\atlassian-jira\WEB-INF\classes

has the email quote separator to check for (e.g ----- origional message ----- ) or any, and that outlook is adding this text when forwording/replying to email message in order for the strip quotes to work in JIRA. for my case I have defined a custom separator and define it in the outlook-email.translations file.

1 vote
Chris Marts February 28, 2013

If you're looking for a more comprehensive regexp to strip replies, we use this:

/From: *|___.*|On .*wrote:|----Orig.*|On .*(JIRA).*/

I've found this gets most mail clients (including Outlook PC/Mac, Outlook Web Access, iPhone, others...)

We're an OnDemand customer so every morning we have to check to make sure the default mail handler hasn't reverted back to the standard Studio Email Handler and if so, re-edit it with the above settings. There doesn't seem to be a way to define our own handler without the default one getting in the way.

Paul Trappitt February 23, 2014

Can anyone confirm if "On .*wrote:" section of this regex pattern actually works?

I'm sending email from gmail and it comes through with On... wrote: but it's not getting caught with this regex pattern.

I've tried testing with just /On .*wrote:/ and that doesn't work either. The only way I can get it to work is with /On/ which obviously is not going to be practical.

I find it strange because On .*wrote: wouldn't normally match anything as it appears invalid. I would have thought you would need a word boundary like On\s.*\bwrote\b.*

But JIRA just spits the dummy at this, I'm guess it can't handle any escapped chars. I can't really seem to work out what regex engine it's using.

If anyone could confirm how they are handling gmail or if they have this working for gmail it would be greatly appreciated?

Cheers

Paul

Manu Bhardwaj June 14, 2019

I'm facing the same issue...can someone please help !!

Usher Razavi August 13, 2019

"....Wrote:" is an addition by Gmail. Gmail add something like this once you reply to the emails:

"On Tue, Jun 14, 2019 at 12:42 AM Test Man <testman@gmail.com> wrote:"

 

and then you'll see the email from the sender.

That's all different in outlook.

 

Here is one way of doing it:

https://metainf.atlassian.net/wiki/spaces/KB/pages/319946778/How+to+remove+previous+messages+from+reply+emails+using+split+regex

0 votes
petry
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 28, 2012
Andy Brook [Plugin People]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 29, 2012

If the default handlers dont play as well as you'd like, there is also JEMH that merges regexp and create/comment functionality into one handler as well as a bunch of other things.

0 votes
w r May 30, 2012

I'm having this issue as well.. it seems that the simple strip quotes function only strips lines that start with | or >, which is not the way our mail client does replies. So, we too are left having to use the regex handler to strip everything below a certain regex... But I'm thinking that means we have to stop using the "CreateOrCommentHandler" and start using 2 handlers, the "CreateIssueHandler" and the "RegexCommentHandler"

Suggest an answer

Log in or Sign up to answer