Email This Issue
📈 Marketplace❓ Support❤️ Feedback🏠 META-INF Apps
Email This Issue - for Jira Cloud
Email This Issue - for Jira Cloud
  • ⬇️Overview
  • Email This Issue - for Jira Cloud
  • Features
  • How Email This Issue Works
  • Secure the email channel with Email This Issue
  • Comparing Email This Issue and Jira Cloud
  • 📤Outgoing Emails
    • Outgoing emails overview
    • Manual emails
      • Configuring manual emails
      • Sending manual emails
    • Email notification schemes and email notifications
    • Workflow post functions
    • Advanced email configuration
    • Customizing email templates
    • Canned Responses (default messages)
    • Scope evaluation
  • 📥Incoming Emails (Mail Handlers)
    • Incoming emails overview
  • Mail handlers - adding / editing
    • General handler settings
    • Filtering
    • Finding issues
    • Setting up rules and actions in the actions editor
      • Adding/editing actions
      • Adding recipients to Request Participants
      • Creating an issue
      • Updating an issue
      • Setting field values
      • Adding comments
      • Sending auto-reply emails
      • Executing workflow transitions
      • Creating a customer
      • Using split regexp
      • Conditions
      • Approve request
      • Decline request
    • Maintaining email chains
    • Mail Handler New UI
  • Global Sender Address Filters
  • Attachment Filters
    • Regular Attachment Handling Deprecation
  • 🤓Administration
    • Outgoing Mail Connections
    • Alerting via Webhooks
      • Webhooks
        • Configuring Slack to receive alerts via webhooks
        • Configuring OpsGenie to Receive alerts via webhooks
        • Configuring Microsoft Teams to receive alerts via webhooks
      • Webhook execution logs
    • Mail Queue
    • Email Audit Log
    • Permissions
    • Recipient Restrictions
    • Incoming Mail Connections
    • Email Security
    • Incoming Mail Queue
    • Incoming Mail Log
    • OAuth2 Credentials
      • Enabling OAuth2 Authorization in your Google Account
      • Enabling OAuth2 Authorization in your Microsoft 365 Account
      • Troubleshooting guides for Microsoft OAuth2 Connections
        • How to fix "BAD User is authenticated but not connected" error​
        • How to fix "401 Unauthorized" error
        • How to fix "key expires_in " error
        • How to fix "Need admin approval" error
  • ☁️Server to Cloud Migration
    • 🛫Server to Cloud - Automatic Migration tool
      • Preparing for the migration
      • Doing the migration
      • Finalizing the migration in Cloud
      • Migration with unsupported Jira versions causes errors
    • Server to Cloud - Manual migration guide for Email This Issue
  • ❓FAQ
    • No recipients error in outgoing emails
    • How-to add custom macro to email Template?
    • Why cannot I select custom event types in notification?
    • How to configure the Email This Issue addon user in Jira Cloud?
    • I get an error: Could not create request on behalf of the sender
    • Why is the Incoming Mail Queue size limited?
    • Outgoing mail not sent - Read timeout error
    • Access restriction icon is not appearing when adding internal attachments via Email this Issue
  • 🌪️General
    • Release Notes
    • API
      • API for Velocity Context Objects - 1.7
      • API for Velocity Context Objects
    • Addon Pages
      • Integrity Check
      • Feedback and Support
    • Security Advisories
      • Email This Issue Security Advisory September 28, 2020
    • Appendix
      • Supported Time Zones
    • Integration of Glass Documentation
Powered by GitBook
On this page

Was this helpful?

  1. Mail handlers - adding / editing
  2. Setting up rules and actions in the actions editor

Using split regexp

Instructions for removing previous mail history when creating issue or adding a comment

PreviousCreating a customerNextConditions

Last updated 6 months ago

Was this helpful?

Use Case

Customers frequently face the issue of having unnecessary or irrelevant content being added as a comment from a reply email to a particular issue.

An email often gets added as a comment to the issue including long threads of previous messages (e.g.: a reply email and the original event notification email to which the reply was sent).

Email This Issue supports the use of regular expressions as a way of separating the latest message from previous ones, and adding only relevant content from a reply email as a comment to the issue.

How to solve this problem

In this section we will show two different approaches to remove old content from reply emails, each with their own advantages and disadvantages.

Reactive approach

This is the classical split regex approach, which attempts to split the email body based on how various email clients format reply emails. The problem with this approach is that mail clients format reply emails differently which makes splitting difficult and prone to errors. Here are two examples of the two most widely used email clients (Gmail and MS Outlook). The red frames mark the expressions people usually try to match when wanting to use regular expressions.

Gmail example:

MS Outlook email example:

Note: In the above MS Outlook example the reply is sent to an email that is marked by From: Sent: To: and Subject: text.

We recommend that for multi-language purposes you try using the following regular expression in order to escape the bold formatting as well: \s*\*From:|___.|On .wrote:|----Orig.|On .(JIRA).

Note: On cloud instances, split regex uses perl syntax, therefore it must be entered between forward slashes.

Note: With this approach you don't have to modify templates, but it has many disadvantages. As it requires complex regular expressions, making it easy to mess up. It is unreliable, as the expressions depend on the mail clients, and there's a high probability of information loss.

Proactive approach

This approach attempts to split the email body at a well defined, previously known, unique marker.

Why we recommend using a proactive approach with Email This Issue:

  • It is easy to use as it requires creating only one regex pattern.

  • It does not depend on mail clients.

  • Information loss is less probable.

  • Visible markers improve customer usability.

The proactive approach has two small drawbacks:

  • It requires the use of custom templates in which the markers can be placed.

  • Due to the need of custom templates, you must implement issue notifications in Jira using Email This Issue (in case of non-service desk projects).

Note: We highly recommend using a proactive approach with Email This Issue.

Step by step guide

Using the following visible content marker will have only the latest email content above the delimiter be added as a comment.

1. Simply add a delimiter to the top of the body in your email templates such as adding: --Please reply above this line--

2. Add a regular expression that matches the delimiter and don’t forget to insert it between forward slashes „/”

Result: If the above settings are carried out, then the following results are to be expected. The original email is cut using a visible content marker:

Comment added to the issue, email cut above the visible content marker:

HTML format

Wiki format

<hr />

----