I want to find any email address in any JIRA ticket, how can I achieve this?

Solveig Petersen January 8, 2021

Hello community,

I would like to search for any email address, possibly in form of a regex, in any Jira ticket in any of the text fields & comments. The goal is to have an automation post a comment in the ticket, where an email address was found.

1.  I have tried to set up an automation like this, but it does not seem to work. The audit log says, no actions were triggered. I'm not too familiar with regex'es so I tried different ones that I found, none worked. 

Bildschirmfoto 2021-01-08 um 13.06.38.png

2. I have tried to search in a JQL for text ~ "@", but this does not seem to be allowed by Jira (because @ is a reserved special character) and does not work either with the workaround that I found, that was suggested in the community forum which would be text ~ "\\[@\\]", I believe.

 

It would be great if you could support me in solving this issue. Thank you in advance for any insight.

2 answers

1 vote
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2021

Have you tried looking for “.com”

Solveig Petersen January 8, 2021

Hi, thanks for the idea, but I'd have to include every possible TLD there... but .com and a few others (the most likely ones) would probably be a good starting point. I will try it out.

Solveig Petersen January 8, 2021

I just realized, that it does not only find email addresses but also URLs, so this is not an option, unfortunately.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2021

yep not ideal but a start. if this is something you need to assess regularly you might consider incorporating Automation and add a label "email". 

Solveig Petersen January 8, 2021

Hi Jack, sorry, I don't understand your idea to - incorporating Automation and add a label "email". Would you be so kind to elaborate? My goal is to have an automation running, looking for tickets with an email address somewhere in the text fields and then have the automation comment on these tickets. 

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2021

well I was just thinking that you might have a rule that triggers when an issue is create or edited and search the field for an email and if it finds one then a label is added. then you can simply use the label in a JQL going forward to check for issues containing and email.

Now, whether this makes sense or is doable really depends on the details of your situation. For example where might these email addresses appear in the issue? A single field or any text field. If I understood exactly what we are dealing with here and why you are trying to ferret out the issues w/ emails I might have a more appropriate answer for you.

0 votes
Muhammad Ramzan(Atlassian Certified Master)
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.
January 8, 2021

Hi @Solveig Petersen ,

 

Can you please elaborate about the text field , here is my suggestion please let me know if it makes any sense to you.

 

Create multiple conditions like 

 {{issue.assignee.emailAddress}}

matches your reg expression

 

 {{issue.reporter.emailAddress}}

matches your reg expression

 

 

{{issue.comments.author.emailAddress}}

matches your reg express

 

You can also add your text fields and then can match.

 

This regular expression will match all type of emails

^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$

Suggest an answer

Log in or Sign up to answer