Incoming email should be a new issue instead of a comment in JSM Cloud
プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。
要約
Assume that you've setup an Incoming Email address for your Service project. It can be the project's default, or a custom one. We're not considering rejected emails.
The Decision Process
When it is processing an email it received, Jira will check three places for information to decide whether that email should be processed as a new issue or a comment to be added to an existing one:
- Sender
- サマリ概要
- ヘッダー
With the above in mind, the usual flow looks like this:
- Does the sender have the proper permissions on the project?
- Is your project open so anyone can send a request?
- If not, is the sender a customer for this particular project?
- Does the Subject of this email contain an Issue Key?
- If it does, is this particular sender involved in that issue?
- Is anyone allowed to comment on an issue as long as it has been identified with its key?
- If there are multiple issue keys on on the email subject, the first one mentioned (leftmost) takes precedence on the decision
- Do the email headers contain references to other emails processed by Jira in the past?
Mail Headers
While steps #1 and #2 above are simple, the third can be tricky. Jira will consider the following specific headers when analyzing the email headers: Message-ID, In-Reply-To, and References.
An email that is sent within a thread may headers like these:
In-Reply-To: <example_address@atlassian.com>
Date: <Day, date, timestamp, time zone>
Content-Transfer-Encoding: 7bit
Message-Id: <message_id@atlassian.com>
References: <reference_id1@atlassian.com> <reference_id2@atlassian.com>
To: support@<site>.atlassian.net
Whenever Jira processes an email, that email's Message-ID header is stored in the notificationinstance table in its database.
For any new email it processes, Jira will attempt to match the IDs it finds in those headers to the data stored in that notificationinstance table. If any of them matches, a new comment will be added to the issue stored (by its ID) in the source column.
Edge cases
There are cases where how your customer sent an email will affect that decision process and can cause confusion:
Let's say that your customer needs to create two issues in your Service project, and does so via email.
- They write the first email with the subject "Need assistance regarding X" and send it to support@yourinstance.atlassian.net
- Next, they forward or reply to the first one, but change the subject to "Need assistance regarding Y" and send it to support@yourinstance.atlassian.net again
- Note that the second email does not contain the Key from the issue that was created by the first one
- Contrary to expectation, the second email is added as a comment on the ticket created by the first one, not as a new request
This is where the headers are most relevant. By forwarding or replying to the original message, instead of creating a new email from scratch, their email client will add the original email's Message-ID as a reference in the new one. This occurs even when changing the email body or subject.
With the Message-ID included in the headers, Jira will match the new email to the first one, thus creating a new comment instead of a new issue.
Because of this, we'd advise you and your team to always create new emails from scratch when a new ticket is necessary.