JIRA Mail Handler: can you set a custom field and then assign a reporter based on that field?

Steve Chavez September 14, 2015

Hello,

We've just completed an upgrade to our in-house CRM. This application sends notifications using TO, CC and BCC. When one of our technical users adds a note that needs additional action taken on it, they will CC it to an e-mail (mailer@mydomain.com) designated for JIRA to create a ticket.

With our old CRM, each user would send notifications using their default mail client (MS Outlook), so the FROM address would be from the user who sent the note. When JIRA received it, it would use that to assign the reporter.

In our new CRM, when a user sends a notification, the mail client is instead using a mailer api, so the FROM address is now an application e-mail (myapp@mydomain.com).

The e-mail that gets sent will always show what user added the notification, so you have something like this from John Doe:

Notification sent from jdoe (tech) - 01/01/15 9:00 PM:

Here is my note about the customer and any actions that took place as well as actions that may need to take place.

Customer information here

What I'd like to do is use some kind of mail handler and custom key (maybe script) to pick up on "Notification sent from" as the custom key and take the next string as the value, then set that value as the reporter.

Some users do not use JIRA. So I'd need to do something similar to this:

sentBy = jdoe
If (sentBy is not a JIRA user), set reporter as anonymous (or default if needed)
Else set reporter of ticket to sentBy

 

Update: The user's JIRA user and username pulled by the application are the same because they both come from Active Directory (jdoe = jdoe@mydomain.com).

 

Am I explaining this correctly? I couldn't find any current articles in the knowledge base that really fit (may have not used the right words).

 

Thank you

 

1 answer

0 votes
Piotr Klimkowski
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.
September 14, 2015

If you feel like it you can create custom mail handler, see here https://developer.atlassian.com/jiradev/jira-platform/email/tutorial-custom-message-mail-handler-for-jira 

This way you can handle the message just about any way you want. Take a look at CreateIssueHandler JIRA source distribution to get the idea of what needs to be done.

Suggest an answer

Log in or Sign up to answer