Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Map field as per email message while creating issue

Priti Sonar December 14, 2022

Hello , 

Their is requirement to map/set  fields from email message whenever ticket gets created using incoming mail handler .

Description of the mail consist .

  
 fields in mailfield in jira issue
created byReporter (value -ABC)
TitleService request title/subject  -- will set the title of ticket 
EngagementEngagement -- some value 
prioritypriority -- low 

 As per above data , whenever the mail is send in such way . the field in mail should get map to the existing jira custom fields with their value .

Could you please provide a scripted mail handler code for the Above Requirement.

Let me know if you need anything .

1 answer

1 vote
Nic Brough -Adaptavist-
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.
December 14, 2022

So from your list:

  • Reporter: will be automatically captured
  • Priority: will be taken as Low/Medium/High, as long as you have those in the project's priority scheme
  • Title: Isssues don't have titles, they have a summary, which will be taken from the subject line of the email

Less about your list:

  • The description of an issue will be taken from the body of the email.
  • The rest of the fields you describe are going to be a problem,  Emails do not naturally contain fields, so you're going to need to find or write something to parse the body of the email into your fields (and presumably drop it from the description)

There are several apps in the marketplace that can help you with this.

Priti Sonar December 14, 2022

Hi @Nic Brough -Adaptavist- ,

Thankyou for the information .

Could you give me some code from which i can split the description into parts and according to some match we can set the field.

It will be really helpful

Nic Brough -Adaptavist-
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.
December 16, 2022

A good starter for your own email handler is at https://library.adaptavist.com/entity/create-a-new-issue-using-a-mail-handler-script-and-set-the-epic-link-to-an-existing-issue-found-in-the-mail-body

This just looks at the epic link field, but the same applies for any custom field

Suggest an answer

Log in or Sign up to answer