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?
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.