Forums

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

What JQL can I use to search a text field for a specific string and ONLY that string?

Cash Coyne
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 8, 2024

I want to do a JQL search for an exact match to a string and ONLY those characters are in the string.

For example, I want to find all issues where the value of the text field MyString = "0"

I can use MyString ~ "0", but that finds so many non-0 instances. For example:

  • 0.0
  • 3.0
  • 120.54

I want to find issues with "0" and only "0" in them.  How can I do this with JQL?

4 answers

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.
July 9, 2024

Hi @Cash Coyne 

I do not believe that is possible with the built-in JQL...

The EQUALS = operator is not supported for such fields and the CONTAINS ~ operator uses fuzzy matching, even when the exact match syntax is used.  (e.g., summary ~ "\"123.456\"" )

Depending upon your scenario details, you could try an automation rule which allows more control over comparisons or investigate marketplace addons for JQL.

Kind regards,
Bill

0 votes
Prosper Agwegiokhe
Contributor
July 10, 2024

Hi @Cash Coyne,

I’m Prosper, a support engineer at Appfire, and I’m here to help you.

The app my team works, JQL Search Extensions for Jira, you can use the query below for a jql text search exact match:
issue in exactTextMatch("text").

This searches and returns issue(s) that contain the text in the summary, description, or environment fields, and is case-sensitive.

Please contact our support if you have any other questions about this query.
We’ll be happy to help you!

Best regards.

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
July 9, 2024

Hi @Cash Coyne

as already suggested, I don't think that this is possible in plain JQL.

If you're open to solutions from the Atlassian Marketplace, you'll find options there that either extend JQL by additional functions, or use their own, alternative search and filter mechanisms.

E.g., your use case would be easy to solve using the app that my team and I are working on, JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a range of advanced features, including support for (configurable) issue hierarchiesissue grouping by any issue field(s), sum-ups, or conditional formatting - as well as the ability to filter issues via regular expressions

With regular-expression-based filtering, you can apply pretty much any logic, including the one that you are after:

regex-filtering-zero.gif

The regex that I'm using is

(^0 )|( 0 )|( 0$)|(^0$)

- but you really can use any regex that you think is appropriate.

Once you've identified your issues, you can work on them directly in JXL (e.g., bulk edit them via copy/paste), or trigger various operations in Jira.

Any questions just let me know,

Best,

Hannes

0 votes
Manav Shah
Contributor
July 8, 2024

Hey @Cash Coyne!

"FieldName" ~ "0" is working for me pretty well. Are you sure its giving you 30? Try "FieldName" ~ "0.0"

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