Forums

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

How to extract an email address from issue description field?

Marvin Brand July 10, 2023

Hi there Atlassian Community,

I know this topic already exists (here) but I have a little extra challenge. 

I set up an e-mail handler which is creating me issues in a JWM project. The e-mail body text is placed in the description field of the issue – this works fine.

The e-mail text is the following:
A user with the email address "name@mail.com" has requested access to your product.

Now, for each issue will be created, I'd like to extract the e-mail address out of the text and put it into the summary or a custom field.

I'd like to use Jira Automation for this an already experimented with smart values to extract the string (reference here). Unfortunately a lot of smart values work with quotation marks (") as an operator to indicate substrings.

Problem: And as you can see in the e-mail text above, the mail address is already provided within quotation marks.

You got any ideas how to solve this?

4 answers

1 accepted

3 votes
Answer accepted
Sayed Bares _ServiceRocket_
Community Champion
July 10, 2023

@Marvin Brand Welcome to the community!

You can use the following smart value into your summary field:

{{issue.description.substringAfter("\"").substringBeforeLast("\"")}}

 share.jpg

Hope it helps!

Marvin Brand July 10, 2023

Hi @Sayed Bares _ServiceRocket_ ,

thanks for your reply!

We're coming closer. I get the following value from your suggested smart value:

 

name@mail.com|mailto:"name@mail.com] 

 

Any idea how to get rid of the second part "|mailto:"name@mail.com]" ?

Marvin Brand July 10, 2023

Hi again @Sayed Bares _ServiceRocket_ ,

just found out this only accurs when there's a hyperlink (mailto: …) behind the string of the mail address.

Since the issues are created over the mail handler with unformatted text, your suggested smart values does work!

So I'm happy so far with your provided solution, but if you have further ambitions, I am of course happy about a refined solution.

Thank you!

0 votes
James Luther
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 6, 2025

You are absolutely right about the challenge with quotation marks in Jira Automation. Since smart values often use quotation marks to define strings, trying to extract an email address that is already inside quotation marks can be messy. The good news is that this can still be handled using regex inside Jira Automation smart values. In most Jira Cloud environments, this should successfully extract the email address. You can then set this smart value in your custom field or even in the summary if needed.

Now, if you ever need to do this at scale—suppose you are exporting data from Jira to text files or handling hundreds of emails—you could find Jira Automation to be somewhat limited. In such situations, you could wish to investigate a tool such as Softaken Email Address Extractor. It is specially designed to extract email addresses from all types of text content, whether it is stored in .txt, .doc, .eml, or .msg files. This is a really useful option when automation rules, when you exceed your limits, or when you are working with old email exports or ticket archives. 

Bill Sheboy
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 7, 2025

Hi @James Luther -- Welcome to the Atlassian Community!

What is your association to the product you are recommending?

As a reminder...when recommending a marketplace vendor product, please ensure you disclose your affiliation to that vendor in your post wording, and not just in your profile name. For more information about this, please see:

Atlassian Partners - Rules of Engagement

https://community.atlassian.com/t5/App-Central-articles/Atlassian-Partners-Rules-of-Engagement/ba-p/2899328

 

Also please see the community guidelines regarding necro-posting to threads:

https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement

 

Kind regards,
Bill

Like SilkeS likes this
SilkeS
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
May 7, 2025

@James Luther I removed a promotion that’s against our  Atlassian Partners - Rules of Engagement . Please take a moment to review our guidelines so you're aware for next time. 

If you're part of a Marketplace App team, we would like to ask you to follow the steps outlined  here  to get an 'Atlassian Partner' lozenge for your profile! Cheers!

Like # people like this
0 votes
Dan Reinmann
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 11, 2025

{{issue.description.substringAfter("[mailto:").substringBefore("]")}}

0 votes
Marvin Brand July 10, 2023

@Bill Sheboy

I've seen you a lot commenting on automation and smart value topics. Maybe you can help?  

:-) 

Bill Sheboy
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, 2023

Hi @Marvin Brand 

Based on the other solution posts where you were helped, it seems the remaining part you are trying to do is parse the following:

name@mail.com|mailto:"name@mail.com] 

So you only get one email address.  Is that correct?

If so, you could either use the substringBefore("|") to grab the first value, or use split("|").get(0) to convert to a list and grab the first entry.

As a reminder, using automation rules requires learning and experimentation.  I encourage you to try things, write entries to the audit log, and see what happens in order to guide your rule writing.

Kind regards,
Bill

Suggest an answer

Log in or Sign up to answer