from e-mail request to JIRA custom fields

Anna Arczynska
Contributor
May 19, 2023

Hi community,

I have such question. Is there any way to automatically get some information from email request send by cusotmer.


For example customer always use the same template to send request to jira

Name : XYZ
Surnamne: ZZZ


Is there any way to grab those fields automatically and put them to the prepared already custom JIRA fields? 

2 answers

1 accepted

0 votes
Answer accepted
Gomez, Daniel
Contributor
May 19, 2023

To extract the name and surname from an email body and populate custom fields in a JIRA issue, you can use JIRA's Smart Values along with regular expressions. Here's an example of how you can achieve this:

1. First, you need to define the regular expression patterns to match the name and surname in the email body. Assuming the email body contains lines like "Name: XYZ" and "Surname: ZZZ", you can use the following patterns:

- Name Pattern: `(?im)^Name:\s*(.*)$`

- Surname Pattern: `(?im)^Surname:\s*(.*)$`

2. In JIRA, when configuring the email channel, you can use Smart Values to extract the name and surname from the email body and populate the corresponding custom fields in the JIRA issue.

For example, if you have custom fields named "Name" and "Surname" in JIRA, you can configure the email channel's custom field mappings as follows:

- Name Field Mapping: `{issue.description.matches("(?im)^Name:\\s*(.*)$")[0].group(1)}`

- Surname Field Mapping: `{issue.description.matches("(?im)^Surname:\\s*(.*)$")[0].group(1)}`

These Smart Value expressions use the `matches` function to search for the regular expression patterns in the email body (`issue.description`). The extracted values are then retrieved using the `group` function with the index 1.

With this configuration, when an email is received and converted into a JIRA issue, the values of the name and surname fields will be extracted from the email body and populated in the corresponding custom fields in the JIRA issue.

Make sure to adjust the regular expressions and field mappings based on the specific format and content of your email template. Additionally, ensure that the custom fields in JIRA have the correct names and are properly mapped in the email channel configuration.

I'm using the automation built in to jira cloud

 automationbuiltin.png 

 

vasanth
Contributor
July 31, 2023

Hi 

we can use the Email This plugin to set up a field when an email is sent by an incoming handler.

I am also working on the same issue

Michael
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.
November 25, 2024

@Gomez, Daniel

Can you please provide a step by step example of this? I'm not understanding where these "Smart Values" are kept, how to extract them from an email to Jira ticket (via data center) or where the "email channel" you are describing is located.

Thanks,

Mike

0 votes
Steve Long -Evelon-
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.
May 19, 2023

Hi @Anna Arczynska

Unfortunately, not within native Jira Service Management.

The email handlers are rather basic in that Summary > Summary and Body > Description.

There may possible be a plugin on the marketplace that supports this, but I haven't encountered one during my years given the complexity involved.

It's always best to try and divert your end users to the customer portal if possible!

Hope that helps - Steve.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events