JQL

Lesley Hamel November 23, 2023

In my JQL syntax, how can I check for specific syntax?

e.g. find all text in the specific format 'XXX999'

3 answers

2 accepted

2 votes
Answer accepted
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2023

Hi @Lesley Hamel 

I've give this a go:

summary ~ "\"XXX999\""

Ste

Lesley Hamel November 23, 2023

Thanks Stephen, but this identifies any instances of 'XXX999' wonderfully, but I want to identify any instances of content in this format, eg. I'd like it to find 'AGH145' and 'IOK456' etc. 

I think I need to look outside JQL

Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 30, 2023

Hi @Lesley Hamel 

I don't know of a native way of doing this.

Could you use Automation for this? For example...

  • Create a checkbox field, with one value (Yes) - named "XXX999 Format?"
  • Populate the field via Automation if that format is used in the Summary

...then use that field in the JQL instead?

Ste

1 vote
Answer accepted
Ollie Guan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 23, 2023

Hi @Lesley Hamel ,

The JQL field "text" as in text ~ "some words" searches an issue's Summary, Description, Environment, Comments. It also searches all text custom fields.

text ~ "XXXX999"

https://support.atlassian.com/jira-service-management-cloud/docs/jql-operators/

Lesley Hamel November 23, 2023

Thanks Ollie, what I'm hoping to search for is any test which is in a particular FORMAT, rather than containing specific CONTENT.

In my example search for text content in the format 'XXX999', I'd like it to 'find' these:

ABC123, ABC456, DEF456, QZP603 etc etc

0 votes
Humashankar VJ
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.
February 11, 2024

In JQL (JIRA Query Language), you can use the ~ operator along with the tilde symbol (') to perform a text search using regular expressions. To find all text in the specific format 'XXX999', you can use a regular expression like 'XXX\d{3}'.
Here's how you can write the JQL query:

arduinoCopy code
text ~ 'XXX\d{3}'
In this query:
• text is the field you want to search in. You can replace it with the actual field name where you want to perform the search, such as summary, description, etc.
• ~ is the operator used for performing a text search using regular expressions.
• 'XXX\d{3}' is the regular expression pattern. Here:
• ' is the tilde symbol used to enclose the regular expression pattern.
• XXX matches the literal characters 'XXX'.
• \d matches any digit.
• {3} specifies that the previous token (which is \d) should be repeated exactly three times, so \d{3} matches three consecutive digits.

This query will return all issues where the specified field (e.g., summary, description) contains text in the format 'XXX999'.

Adjust the field name as needed for your specific problem statement

Kindly let me know if this works 

visby8em February 8, 2025

@Humashankar VJ 

This does not work as JQL does not recognize \d. Can you confirm how were you able to make it using JQL?

snip.png

Humashankar VJ
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.
February 8, 2025

Hi @visby8em 

Can you try - summary ~ "XXX*"

This finds all summaries containing XXX followed by anything, basically It does not strictly enforce three digits after XXX.

Keep me posted if you need any additional assistance.

Regards

 

visby8em February 9, 2025

There is no need for a * either.

Simply doing summary ~XXX will search any summary having XXX

Humashankar VJ
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.
February 9, 2025

@visby8em 

It works either way with the below given options, however there is a nature behind that, and it will retrieve outcome. You can keep me posted for additional clarifications.

 

summary ~ "XXX*"

summary ~ "XXX"

summary ~ "XXX???"

 

Regards

Suggest an answer

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

Atlassian Community Events