Configure Mail Handler to set Priority and custom field for triggered issue.

dhaval soni
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.
August 21, 2013

Hi !

I have setup mail handler in jira by follow below link:

https://confluence.atlassian.com/display/JIRA/Creating+Issues+and+Comments+from+Email#CreatingIssuesandCommentsfromEmail-

testmailhandler

Jira verion: jira 6.0.5 dedicated server (not ondemand)

My query is ,

When issue trigger from email, i want to populate one custom field from email. I am fine to keep this field in email any where subject/body which can allow to populate into the custom field of issue.

How can i achieve this ?

Also, How can i set priority of newly triggered issue ?

Thank You

Dhaval Soni

4 answers

2 votes
MattS
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 10, 2017

Not documented much but this is what JIRA does with the X-priority email header in CreateIssuehandler.java.

/*
* NOTE: Valid values for X-priority are (1=Highest, 2=High, 3=Normal, 4=Low & 5=Lowest) The X-Priority
* (priority in email header) is divided by 5 (number of valid values) this gives the percentage
* representation of the priority. We multiply this by the priority.size() (number of priorities in jira) to
* scale and map the percentage to a priority in jira.
*/

0 votes
hrzadnn January 12, 2015

Hi @dhaval soni,

so did you find out how to configure it?

Many thanks in advance!!

Cheers,

H

0 votes
dhaval soni
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.
August 21, 2013

I am fine if any groovy script/any other way allows to populate custom field from email..

any stuff will be appreacite?

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.
August 21, 2013

The mail handlers shipped with Jira simply are not that clever. They mostly do create or comment, with some minor processing, but they are not capable of advanced data processing.

You will need to find or write a mail handler to do this.

For writing one, it's a pretty standard plugin, not too hard to code, and you can do what you like in the code - parse it for custom fields, work out a priority and so on.

For finding a plugin, there's not really much option because JEMH is by far the most flexible and powerful email handling system you'll find for Jira. Before you even pick up any coding tools, make sure you read through it - I'm 99% sure it can do exactly what you need (and a lot more). There might be others, but I always reach for JEMH, and I've only run into one very obscure case it couldn't handle (solved by educating the users and eventually getting them to replace their email admins with someone who had a clue about running email services)

dhaval soni
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.
August 21, 2013

JEMH shows support for jira 5.2.11 and my jira version is 6.0.5.

Can you please share example link for creating mail handler plugin which allows me to populate custom field into jira issue OR any stuff.. ?

Thank You

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.
August 21, 2013

Best place to start writing is https://developer.atlassian.com/display/JIRADEV/Custom+Message+(Mail)+Handler+for+JIRA

Although I'm sure JEMH will catch up soon...

Bart Meerveld
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 2, 2016

Nic this is 3 years ago have the options expanded by now?

 

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.
September 2, 2016

No.  Priority can be set if you've set a high/low priority field in emails, and Service Desk has its own email handler, but the core has not changed.

Bart Meerveld
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 4, 2016

Thanks for the answer nic. We work with 4 priorities, p1 to p4. Our default is p3 so our mail handler sets incidents to this. High priority mails are set to p1, any way to change this to a p2?

 

For p1s our entire management is notified so i'd rather not have any mistakes in this.

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.
September 5, 2016

Answered on your main question.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events