Can the JIRA Incoming Mail Handler that uses regex parse HTML/XML tags?

For instance, if I want to split on the 5th <div> tag, is that possible, or is the markup already processed by the time the text hits the regex filter?

1 answer

This widget could not be displayed.

* What regex filter are you talking about?

* In a message handler you can extract the mail body like this:

MailUtils.getBody(message)

Afterwards you can do with the body whatever you want, also parse it with a regex. 

Thanks for replying!  

The regex filter I refer to is a type of "Mail Handler" which can be found in the "Incoming Mail" administrative options when one is logged in as an administrator on JIRA.

This feature allows you set designate mail servers and set up mail handlers which are events that are performed when a designated server receives mail.

You choose the handler from a designated list of handler types, one of which allows you to parse the email with regex.

regexhandler.png 

I'm trying to set up JIRA to allow email replies to push straight to new issues/comments--but JIRA tends to dump the *entire* email, signature and all, into the comment.

I've looked at the underlying HTML in the emails and the only real places where I can consistently "split" the body content from the signature/reply chain/etc. is within <tags> and not the content inside of the tags--which I believe is the only thing that the regex works against in this scenario.

Your welcome.

May I ask what REGEX you used when it didn't find anything?

It would also be interesting to see how the mails are structured that you used for your tests so far.

Have you tried plain and HTML mails and if so, is there any difference in the result?

If your users of this mail handler know about it you can instead of using a tag also use an own identifier / keyword. A REGEX can basically be used to filter everything from simple to complex.

You can test REGEXes (e.g. with this site https://www.freeformatter.com/java-regex-tester.html) to create one that matches your needs.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday 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...

137 views 1 3
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