JIRA is not only able to send e-mails to users, but also to poll and process e-mails. It can also create issues, or add comments to the existing issues. When set up correctly, this can be a powerful way to let your users interact with JIRA.
In this recipe, we will set up JIRA to poll incoming e-mails so that it can create new issues and add comments to the existing issues. This is useful in a help-desk scenario where customers can write e-mails to the company's support e-mail address, and let JIRA automatically create issues from them.
Since JIRA will be polling e-mails from an inbox, you need to have its connection details, including the following:
The first step to configure JIRA for processing incoming e-mails is to set up the inboxes that JIRA will use to poll the e-mails from:
After we have set up the mail inbox, we can set up what is known as mail handlers in JIRA to poll and process e-mails. In this recipe, we will use the most common handler to create and/or comment on issues from e-mail contents:
5
minutes is usually a good delay.Create a new issue or add a comment to an existing issue
handler.The following table explains the various parameters which you need to set:
Parameter |
Description |
Project |
This is where the project's new issues will be created. Note that this is only used for creating new issues. While adding comments, this is ignored, as comments will be added to the issue key specified in the subject. |
Issue Type |
This is the issue type for all newly created issues. |
Strip Quotes |
If this option is checked, the text wrapped in quotes will not be used as an issue description or comment. |
Catch Email Address |
E-mails with the specified address will be processed in this option. |
Bulk |
This option selects how to process auto-generated e-mails such as e-mails from JIRA. This is to prevent creating a loop where JIRA sends e-mails to the same inbox it is polling the e-mails from. |
Forward Email |
This option sets an address for JIRA to forward all the e-mails which it cannot process. |
Create Users |
This option creates a new user if the sender's e-mail address cannot be found. |
Default Reporter |
This option sets the user that will be used as the reporter if the sender's e-mail address cannot be found. |
Notify Users |
Uncheck this option if you do not want JIRA to send account-related e-mails. |
CC Assignee |
Check this option if you want the first user in the CC list to be the issue's assignee in case a matching account can be found. |
CC Watchers |
Check this option if you want to add the CC list as watchers to the issue in case matching accounts can be found. |
The following screenshot shows the previously described parameters:
Mail handlers periodically poll for new e-mails from the selected incoming mail server, and process them based on the handler used. The Create a new issue or add a comment to an existing issue handler will create a new issue in JIRA, where the e-mail subject becomes the issue summary, and the e-mail body becomes the issue description. If the e-mail subject contains an issue key to an existing issue, the e-mail body will be added as a comment to the issue.
JIRA comes with a number of other mail handlers:
/From: *|___.*|On .*wrote:|----Orig.*|On .*(JIRA).*/
JIRA's out-of-the-box mail handlers mostly focus on creating new issues from e-mails, or adding comments to the existing issues, based on certain matching criteria. This means that for each project, you will need to have a corresponding inbox. There are several other notable limitations, including:
Luckily, there is a third-party add-on called Enterprise Mail Handler for JIRA, which addresses all these gaps and more. You can download the add-on from the following link:
https://marketplace.atlassian.com/plugins/com.javahollic.jira.jemh-ui