What JQL can I use to search a text field for a specific string and ONLY that string?
Asked by Cash Coyne:

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?


Answers:
author: Bill Sheboy
body: Hi [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720)

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

The EQUALS = operator is [not supported for such fields](https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#Equals----) and the CONTAINS \~ operator uses [fuzzy matching](https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CONTAINS----), even when the [exact match syntax](https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/#Exact-searches--phrases-) 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


author: Prosper Agwegiokhe
body: Hi [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720),

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](https://marketplace.atlassian.com/apps/1214791/jql-search-extensions-for-jira-reports?hosting=cloud&tab=overview&utm_source=atlassiancommunity&utm_medium=listinglink&utm_campaign=mauricio), 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](https://jqlsearchextensions.atlassian.net/servicedesk/customer/portal/2) if you have any other questions about this query.  
We'll be happy to help you!

Best regards.


author: Hannes Obweger - JXL for Jira
body: Hi [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720)

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](https://marketplace.atlassian.com/apps/1224710?hosting=cloud&tab=overview&utm_source=atlassian-community&utm_medium=referral&utm_content=2748049).

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 hierarchies* , *issue grouping* by any issue field(s), *sum-ups* , or *conditional formatting* - as well as the ability to filter issues via [*regular expressions*](https://regex101.com/).

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

![regex-filtering-zero.gif](https://community.atlassian.com/t5/image/serverpage/image-id/334452i973FFAFBD39447F3/image-size/large?v=v2&px=999 "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


author: Manav Shah
body: Hey [@Cash Coyne](/t5/user/viewprofilepage/user-id/4822720)!

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


Tags: cloud

jira-cloud

jql

query