Remove email history from replies to a Jira mail handler with RegEx

Platform Notice: Data Center and Cloud By Request - This article was written for the Atlassian Data Center platform but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When using a Jira Mail Handler to create new issues, user replies to that mail will add unnecessary email history to the newly created issue. When a user replies to an existing issue, long email history and trails get added to the issue as well.

Environment

Jira Software 9.12.X, 10.3.X

Reproduction steps

  1. Create an Incoming mail server and mail handler

  2. Send an email to create an issue

  3. When the user replies to the confirmation message/acknowledgement, the entire email history is added to the Jira issue

Solution

If the reply email has a body similar to the following:

FROM: TO: Sent: Subject:

We can remove this unnecessary information with a Regular Expression (also called RegEx). Use the RegEx below, and add it to the incoming mail handler for the option "Split regex."

/(\r?\n|\r)From:.*(\r?\n|\r)Sent:.*(\r?\n|\r)To:.*(\r?\n|\r)Subject:.*/i

Comments are added as expected, filtering out the email trail.

Updated on September 26, 2025

Still need help?

The Atlassian Community is here for you.