Classic Mail Handlers

Mail Handlers in Jira provide basic functionality to create issues or comments from emails. In most cases, it's out-of-the-box native functionality is limited.

Important: As of version 9.2.0 Classic handlers have been deprecated and do not work anymore. Switch to Next Gen handlers as soon as possible.

For the Next Generation Mail Handler documentation, click here.

For a comparison between Classic and Next Generation Mail Handlers, click here.

Configuring Classic Mail Handlers

Classic Email This Issue Mail Handlers are composed of two components. The two basic steps to configure a mail handler are:

  1. Adding a Mail Handler in Jira's Incoming Mail Page to hook into the Jira API that passes the downloaded email messages to the handlers

  2. Adding a Mail Handler Context in Email This Issue to fully configure the rich functionality that comes with the addon

Note: If a Mail Handler Context is not added, one is created upon the first email being processed with default settings.

The handler type must be set to Email This Issue Mail handler in Jira. The following image is an example for Jira's Incoming Mail Handler with Email This Issue Mail Handler type:

Mail Handler Contexts

Mail Handler Contexts just like any other "Contexts" in Email This Issue are used to add configuration in a flexible way depending on Project and Issue Type. You can define "broad" contexts that are applied to all projects and/or issue types (in this case, leave the project and/or the issue type fields blank).

Mail Handler Contexts are used in conjunction with the Email This Issue Mail Handlers. If you set up the handler to create issues in the project "MyProject" of issue type "Bug", there must be a Mail Handler Context configured to match this combination, e.g. a Mail Handler Context configured with project "MyProject" or issue type "Bug" or both.

Mail Handler Context Attributes

Split Regex Support

Email This Issue Mail Handler supports regular expressions to split the email body into new content and original messages and import only the new content. See this our tutorial and the Jira documentation for more details on this topic.

Multiple regular expressions can be entered in the Mail Handler Context.

Split regex support works the same way as Jira's but Email This Issue supports multiple expressions not only one expression.

Regular expressions must follow Perl5 syntax.

An example regex that many users successfully use is:

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

Note: Split regex may match HTML tags in HTML emails.

Email processing strategy

If you configure Email This Issue Mail Handler in the Incoming Mail section of Jira's Administration page, you must add a corresponding Mail Handler Context to fine-tune your mail handler.

The following image is an example for a fully configured Classic Mail Handler:

HTML content preserved with inline images

The Classic Mail Handler retains the HTML layout and content of the incoming emails including inline images. Send an HTML formatted email to Jira and see the original content and layout in the issue.

Important: This feature only works if the Issue Description and Comment fields are configured with the JEditor Renderer type. This requires JEditor to be installed and licensed properly in Jira.

Execute transitions on issues

The Email This Issue Mail Handler can execute a transition on the issue that is associated with the email that is being processed.

The transition to execute is identified by a transition property called jeti.on.email.transition. Add this property to the transitions in the statuses of the workflows, set its value to "true". Email This Issue executes the first transition that has this property in the status the issue is in. You must also enable the "Execute transition" attribute in the Mail Handler:

Example use cases for this feature

Use Case #1: Email This Issue mail handler is processing an email that is associated with an Issue that is Closed. Email This Issue besides adding a comment to the issue may also execute a "Reopen" transition to reopen the issue for further investigation.

Use Case #2: Email This Issue is processing an email and creates a new issue in status Open, and after the issue is created it executes a transition to move the Issue to a new status called "Raised via email".

Blacklisting

Email This Issue Mail Handler skips processing emails sent from blacklisted domains or email addresses. Items on the blacklist are regular expressions. If the sender's email address matches any of the regular expressions, the email is not processed.

If you configure the Mail Handler in Jira Administration / Incoming Mails with the forwarding email option, then Email This Issue will forward the skipped emails to this address.

The blacklist is maintained in the Configuration tab of the Email This Issue Admin screen:

Fallback to Default Reporter

Email This Issue Mail Handler falls back to the Default Reporter when Jira users who send an email do not have permission to create or comment on the project. Jira would simply skip these emails, while Email This Issue imports them with the default reporter. The default reporter is an appointed user account (a real or technical one) that is an agent on the project and has all the right permissions to create issues and add comments.

Fire Event

Email This Issue Mail Handler can fire an event when it processes an email:

Example use cases:

  • Define a custom event in Jira Administration, e.g. "Email Processed" (this is optional, you can use a system event too just like on the above image).

  • Edit your Mail Handler Context and select "Email Processed" in the Mail Handler Event field.

  • Configure your Email This Issue Event Notifications for "Email Processed" with recipients or have a custom Event Listener to react to emails.

Last updated