Mail Handler Subject Change

Andrei Iorga July 14, 2020

I configured a 'Create a new issue or add a comment to an existing issue' mail handler and I have the next scenario: I reply to a email that has an issue key, but I change the subject removing that issue key. The default behavior is that even if I removed the issue key it does not create a new issue, instead it adds the body of the mail as a comment to the existing issue. I want that when I change the subject to create a new issue. Do you think that is possible?

1 answer

1 accepted

0 votes
Answer accepted
Andrew Laden
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 14, 2020

The Jira mail handler has a few ways to try to match an emailed issue to an existing email., One way is via looking at the "in-reply-to" or "in-response-to" mail headers. 

(depending on your mail client) When a new mail is sent in reply to another mail, in includes a header that says what mail it it was in response to. Most mail clients do this, and it is how they are able to have "threaded" conversations in mail.

Jira will read these headers, and look to see if it refers to a mail previously received that was attached to a ticket, and if so, will comment on that issue. This is why even though you change the subject/remove the issue key, it still gets appended to the issue.

A few ways around this.

From the person sending the mail

  1. Dont use reply/forward. a blank email and cut and paste what you need. 
  2. In some mail clients, if you reply a 2nd time from the same mail, the 2nd mail will not have the reply to headers set. This breaks threading, but will also force jira to create a new issue.

On the Jira side

  1. In your inbound mail config, use the Handler "Create a new issue from each email" instead of the create or comment one. This will make every email create a new issue, if that is what you want. (though you lose the adding comments by email function.
  2. Look at 3rd party mail handlers, like Enterprise mail handler for Jira. they may have more options to allow to to customize how mail is ingested, like the ability to turn off the "in-reply-to" processing. https://marketplace.atlassian.com/apps/4832/enterprise-mail-handler-for-jira-jemh?hosting=server&tab=overview

Suggest an answer

Log in or Sign up to answer