text ~ does not seem to be working when searching Summary?

AB February 21, 2019

I am trying to use the ~ operator with text as per https://confluence.atlassian.com/jiracorecloud/advanced-searching-fields-reference-765593716.html#Advancedsearching-fieldsreference-textTextText to search for issues which have 'xyz' or 'xyz*' in their Summary, Description and/ or Comments fields.

The search string looks as below, but the results are excluding issues where xyz appears in 
the Summary field. Any idea what I may be doing wrong?

text ~ xyz 

Version: JIRA v7.10.2
              JIRA Service Desk Application v3.13.2 (License Information for JIRA Plugins)

1 answer

0 votes
Maksim Smetannikov
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 21, 2019

Hi, 

The summary field is a separate field from which you can search.

Therefore, your JQL may look like this:

text ~ xyz OR summary ~ xyz

AB February 21, 2019

Hi Maksim,

Thank you for your reply, however the Atlassian Help page I referenced above explicitly states that -

Text

This is a "master-field" that allows you to search all text fields, i.e.:

  • Summary
  • Description
  • Environment
  • Comments

Given this, I am at a loss to understand why a text ~ search will not retrieve those records which have xyz or xyz* values in their Summary.

Is the Help link outdated? I did not find a date on Atlassian's Help pages so have no way of knowing if the Help documentation is current or not. I can explicitly search for the text in the Summary field, but now, I do not know if the text ~ works on the other 3 text fields above as well, necessitating a search in each of them which would be rather cumbersome. 

Maksim Smetannikov
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 21, 2019

You're right. The query text ~ xyz should search the summary field.

Did I understand correctly that the query summary ~ xyz returns issues that text ~ xyz cannot return?

AB February 21, 2019

Hi Maksim,

Thank you for your prompt reply again.

I just checked, Summary ~ xyz is ALSO NOT retrieving the record where xyz123 is a word in the Summary. Now I am really not sure how to proceed.

Maksim Smetannikov
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 21, 2019

Try do a re-index jira.

Just try one project reindex(In which is issue with xyz123 summary).

AB February 21, 2019

So, on further investigation, it appears the issue has to do with the usage (or not) of the wildcard * character. Changing the original search text to

text ~ "xyz*"

works. As does:

Summary ~ "xyz*"

..if anyone were to want to search for issues containing xyz123 in the Summary, Description, Environment, Comments fields OR just in Summary, respectively.

It is STILL not clear, however, why just using

text ~ xyz

 did not work. After all, what then is the use of '~' (or it's difference from '=', if an additional wildcard STILL needs to be used in the search string)?

AB February 21, 2019

So, on further investigation, it appears the issue has to do with the usage (or not) of the wildcard * character. Changing the original search text to

text ~ "xyz*"

works. As does:

Summary ~ "xyz*"

..if anyone were to want to search for issues containing xyz123 in the Summary, Description, Environment, Comments fields OR just in Summary, respectively.

It is STILL not clear, however, why just using

text ~ xyz

 did not work. After all, what then is the use of '~' (or it's difference from '=', if an additional wildcard STILL needs to be used in the search string)?

Payne
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 22, 2019

Without a wildcard, ~ looks for whole words within a field. The difference between ~ and = is that ~ matches if the word appears in the field, whereas = requires that the field match exactly. Then, further, as you've found, you can use the wildcard to match partial words.

AB February 24, 2019

Thank you, @Payne that helps! The distinction between ~ and = is clear now.

Suggest an answer

Log in or Sign up to answer