Forums

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

Trying to understand JQL queries using the "contains" or ~ on a custom text field (single line)

Boyd K
Contributor
June 1, 2023

Working in an 9.4.1 Jira Data Center instance in closed self-managed, self-hosted closed environment.

Trying to understand JQL queries using the "contains" or ~ on a custom Text Field (single line).

In this field was have values like "ABCD-Future-Planning" and "ABCD-1.2.x" and "ABCD-1.2.x, ABCD-1.2.3-Planning" and "ABCD-12X_TEAM1, ABCD-1.2.x-Planning" and so on.

So, when we query for "Case ID" ~ "ABCD", I would think all issues with the values I just cited would return but only those with "ABCD-Future-Planning" return. I do not understand why only those.

When we query for "ABCD-1.2.x" or "Planning" or "ABCD-12X_TEAM1", it looks like we get the correct return.

But, when we query for "12X" or "1.2.x", nothing returns. Again, I do not understand.

Any ideas?

2 answers

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
June 2, 2023

Hi @Boyd K

I believe you are running into Jira's text indexing system, which, as suggested before, tends to behave oddly when it comes to numbers and special characters.

I don't know if this problem justified additional tooling for you, but just to put it out there: If you are open to solutions from the Atlassian Marketplace, there are options available to work around this limitation. E.g., there's a number of apps that extend JQL, e.g. by enhanced text matching capabilities. Alternatively, I myself work on an app that uses an entirely different technique for text searching, in which your use case would be easy to do: JXL for Jira.

text-search-special-chars.gif

(For context, 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.)

Hope this helps,

Best,

Hannes

0 votes
Manoj Gangwar
Community Champion
June 1, 2023

Hi @Boyd K ,

 

You can get all the issues with matching Case ID that have the numbers in it with the below JQL:

"Case ID"~ "ABC*" ORDER BY created DESC

Boyd K
Contributor
June 1, 2023

Thank you, "ABCD*" works for the first case but "*12X*" and "*1.2.x*" still return nothing.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.1
TAGS
AUG Leaders

Atlassian Community Events