JIRA - Comments from Email

Mirek Community Champion May 14, 2012

Hi,

I was wondering is there any very good solution to cut the junk that is added to the comment when replying to tickets using email.. "Very Good" means in this case a situation that JIRA will cut old messeges that was send from different and often used platforms like Outlook, Web Oulook, Android, IPad and so one..

Currently we are using Regex Comment Handler with a property set to cut on /From */ ..It is working pretty well on Outlook, but when using mobile phones it is starting to include the junk..

Problem is also with the languages.. We are working in a global company and when we recive the mail on a mobile phone when using Reply then "From: " is sometimes changed to current language that the employee is using.. JIRA is then not able to cut on "From: " correcly..

We tried the following solution ..

http://confluence.atlassian.com/display/JIRAKB/How+to+Strip+the+Old+Reply+Data+from+Email+When+Using+Outlook

But it is not working for us.. It was even worse then when we used /From: */ regex..It should fix the Outlook but after we did this then Outlook replays were not cut correctly ;)

How you handle the cut functionality? Is is working for you when you are using your mobile device to reply to the comments? Do you have any suggestions or recommendations?

Thank you very much for your help!

-Mirek

7 answers

1 accepted

Accepted Answer
7 votes

We use a longer variation of that:

/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.

Thanks guys, been looking for an answer to this for ages. Atlassian should add this to the documentation ... sending you many vBeer tokens

Thanks Chris. I just noticed that ours got reverted to the regular handler as well. Did you ever contact support or do you have a work around for this? Thanks.

Also, FWIW, this is what we use:

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

I think the digging I did led me to conclude that I shouldn't expect a better workaround from suppot other than just setting it whenever it reverts. Just literally a limitation of how OnDemand works and gets updated.

I have found that update usually happens only over a weekend so I just check it Monday morning and change the default handler to use the RegEx.

This worked really well for me when also using it with emails from Gmail. Thank you!

3 votes
Mirek Community Champion Aug 16, 2012

We got the solution!

It sounds like there is a very easy option to use few reqex in one single property.. Everyone that wants to cut email for different case just need to use an alternative sign when defining a reqex

Example:

/From: *|On .*wrote:|On .*(JIRA).*/

Works for us and I hope it will be helpful for others too

Regards,

Mirek

This is exactly what I've been wrestling with and this solved my issue. Thanks for posting!!!

Hi Mierk,

This works great on both Outlook and Gmail when replying to a comment that was generated from JIRA. However, it fails to strip out the old content if we add a reply with a carriage return. Any ideas? The problem is on both gmail and outlook and we are on JIRA 5.2.11 and using the below handler.

  • handler:Add a comment before a specified marker or separator in the email body

Cheers,Gaj

JEMH allows you to specify mulitple regexps for body delimiting (cut off point for the junk), as well as bundling a range of defaults (like the create/comment handler). Agree that languages make this more complex to deal with!

Regarding mobiles, given owners can inject their own 'sent from my awesome pad/insert text here' its difficult to do much for that, other than allow an admin to filter as required.

If you have specific mails that give you problems, Id be happy to look at them out of interest...

Mirek Community Champion Aug 16, 2012

Hi Andy,

Thank you very much for your suggestion and help! JEMH its a very good plugin however unfortunately is not a free and on the other hand we do not want to add more plugins to our instance. We already have a lot and this is always a problem when doing the upgrade...

Any solutions out there for OnDemand customers using the "Create a new issue or add a comment to an existing issue" Handler??

I just wanted to follow up on this. It has been very helpful! For a long time, this was working great in our OnDemand instance - we had it set up with: 

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

But sometime over the past several months that seemed to not be working quite right as I'm seeing lots of duplicated messages in comments that it's not catching. 

I updated this to the one above:

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

Initial tests show that this is working better...

 

 

Do you have a sample of the change that needs to ve implemented here? - /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/templates/email/html/includes/header.vm

I made an external script https://github.com/zimmski/filter-reply-mailswhich can filter text and html mails and also remove referenced attachments of the trimmed content. It also works with many languages. Another language just means another regex in the filter definitions.
I'm a little bit frustrated that Atlassian stil has no solution to this problem so I hope that my project helps a little bit.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

20,362 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you