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?
@Marvin Brand Welcome to the community!
You can use the following smart value into your summary field:
{{issue.description.substringAfter("\"").substringBeforeLast("\"")}}
Hope it helps!
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]" ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{issue.description.substringAfter("[mailto:").substringBefore("]")}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've seen you a lot commenting on automation and smart value topics. Maybe you can help?
:-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.