Mail-In creates comment in Project without mailhandler

Following situation:

  • I have 2 projects
    • Project A (Key: PA) has a configured mailhandler
    • Project B (Key: PB) hasn't a configured mailhandler
  • now I send a email with the subject "bug-fix for PB-55" to the email adress of the handler in Project A
  • then JIRA creates a comment in the ticket PB-55 and doesn't create a new ticket in Project A (like I would expected)

So is this working as intended? If not, is there a fix for this behaviour?

I would be grateful for any help.

3 answers

1 accepted

1 vote
Accepted answer

It is working exactly as intended.

You don't really associate an email handler with a project. What you're actually configuring is a fall-back. That is, if the handler is not able to work out which issue the incoming email is about, which project it should drop the email into.

All the off-the-shelf handlers are like that, they try to match existing issues first, then create in a project if they fail to match.

There is a fix, if you're willing to do a bit of coding - write your own handler! Or find one that works better for you. (And I can never end an answer about Jira email handlers without pointing at JEMH and telling you that it is almost certainly capable of making Jira incoming email do what you want)

You could also leave the dash out of your ticket reference in the email summary line or move the ticket reference to the body of the email so the handler won't interpret it as a comment on the existing ticket.

In a nutshell this is it, if you happen to include text in the subject of an email that matches a known issue key, most email handlers will use that as a driver for issue identification for commenting. Really, the easiest way to stop this is to not use text that matches other priojects issue keys.

In this case it seems like you want to create some linkage between a new issue in project A with something in project B (otherwise, why mention PB-55 in the sujbect). This is a textual linkage to the issue, what would be a better outcome is if the created issue in A actually had a JIRA issue link to PB-55. As Nic says, JEMH can help with the Email > Pre-Processingoption:

If the addressee ( matches a known project key and projectAutoAssign is enabled, the subject will not be used as a basis for a comment, and will be created in the nominated project instead

Now this is a little more specific than your use case, as its solving a larger problem, how to address email to many projects in a scaleable way. One of JEMH features is auto-assign, where the addressee of an email (eg <strong> is used as the target project issue key. In this way, JEMH can route traffic to project abc, and in so doing, also link the created project to PB-55, using a Subject Directive that looks like:

MIME-Version: 1.0 Received: by with HTTP; Sat, 18 Jun 2011 22:42:26 -0700 (PDT) Date: Sun, 19 Jun 2011 17:42:26 +1200 Message-ID: <> Subject: some text #linkTo=PB-55/relates From: "Andy Brook" <andy@localhost> To: Content-Type: text/plain; charset=UTF-8 some text

For this to work JEMH needs to know that the addressee is an incoming address, so the jemhAddresseeRegexp needs to match, for example .*

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,063 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you