email handler problems - won't create in correct Project

Colin Cattanach October 25, 2017

Hi, what tells the handler to create an issue in the correct Project? I have included a key in the mail subject but the only way I can get get email creating issue in correct Project is to only have one handler - not ideal (or correct)

3 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2017

It is the project you define in the handler.

If you include an existing issue key in the subject, then it will comment on that issue.  Otherwise, it will create a new issue in that project.

Are you seeing it create in other projects?

Colin Cattanach October 25, 2017

Yes. With the Project key (no issue key as I want it to create a new issue) it creates in the first handler in my list NOT the desired Project with the appropriate key. I would expect the key determine the Project surely?

corporalaris October 25, 2017

That's not how it works.

Colin Cattanach October 25, 2017

Not much of answer there. What I would expect is that for each Project I create, I can configure a mail handler which examines incoming mail and creates an issue in the appropriate Project going on the Project key showing in the Subject line. If that is not the case then I need to revisit my thinking and expectations here. I can not add an issue id as I wish to create a new issue. BUT I have a number of Projects and a central JIRA admin email address. External users/testers/team members on each Project need to be able to quickly and easily create an issue on the correct Project.

corporalaris October 25, 2017

The feature clearly states that it will create new issues into the project you select, and the documentation makes it even more clear. 

You cannot do what you want out of the box.

  1. Create your own email handler to support the business logic
    https://developer.atlassian.com/jiradev/jira-platform/guides/email/tutorial-custom-message-mail-handler-for-jira
  2. Using an IMAP inbox, preprocess your emails using PostFix and send them to correct folders within the IMAP inbox folder structure. Then use an IMAP Jira Incoming Mail Server specific to one folder per project.
  3. Use one inbox per project email handler, as the product supports out of the box.

There's no other way, and simply providing a project key will do nothing, as the handler is not designed for that and doesn't work like that.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2017

The email handlers cannot begin to guess where an email may be bound, and they pick up mail asynchronously - for any given email, you can't say which handler will get to it first.

The handlers all have the "project" setting, so the first handler to catch any email will create it in their project.

The way to handle multiple projects is to have different email addresses, one per project, then you can do a simple handler per project.

That said, it's the off-the-shelf behaviour.  If you're willing to invest in code or add-ons (JEMH is the one I usually start talking about), it is possible to create a handler that uses other rules, including parsing subjects or content, and making decisions based on them.

Colin Cattanach October 25, 2017

Thanks all.

0 votes
Colin Cattanach October 25, 2017

jira_image2.jpgjira_image3.jpgjira_top_image.jpg

corporalaris October 25, 2017

The handler will only create issues into SERV341232. This is documented behavior:

https://confluence.atlassian.com/adminjiraserver073/creating-issues-and-comments-from-email-861253784.html#Creatingissuesandcommentsfromemail-Createanewissueoraddacommenttoanexistingissue

  • This field is only relevant for issue creation, not for issue commenting.
  • If an email message contains an issue key in its subject line and that issue key exists in your JIRA installation, the handler will add the email message content as a comment on the issue, regardless of which project the issue is in.
0 votes
corporalaris October 25, 2017

Show us the config for you email handler.

Suggest an answer

Log in or Sign up to answer