Forums

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

Trying to create an automation that searches the description using regex

Sam Gerzon December 18, 2023

I am trying to create an automation that searches all the tickets within a project that contains sensitive data (I have the regex I need for this), and then emails specific users.

 

I am stuck on the syntax of the JQL portion of the Scheduled trigger. How can I combine JQL with Regex? For example I want the JQL to return any issues that have specific numerical formatting in the Description.

I then want that list of tickets to be emailed to specific users. I know to use the send email action, but how do I add the list of tickets the JQL returned?

description ~ (?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$ does not work (syntax is incorrect)

1 answer

1 vote
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.
December 18, 2023

Hi @Sam Gerzon 

The out-of-the-box JQL does not support regular expressions.  It only has limited wildcard handling and a "fuzzy" match supported by the CONTAINS ~ operator: https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----

If you need this type of query often, consider investigating marketplace addons for JQL which might add regular expression support.

If you need this infrequently and are trying to check within 100 issues or less, an automation rule could pull in up to 100 issues with the Lookup Issues action, and then use the match() function with a regular expression on the result set to filter down further.  Please look here if you want to try that: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-text-fields/#match--

If you decide to try that, please test your regular expression with small batches first to confirm it works as you expect.  Regex which works with one tool may not work with the implementation for the match() function in automation rules.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events