Forums

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

Search in comments not working correctly

John Doe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 2, 2024

 

Hello,

Searching in comments does not work correctly when I use the comment ~ "" command

I have 15 tickets with a specific comment (#Department23) and when I filter, only 3 appear

I have tried several ways with different texts, and the same thing always happens.

Is there a way other than "comment ~" to search for a specific text in the comments?

1 answer

0 votes
Radek Dostál
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 2, 2024

Out of box, no. Plugins may include custom JQL functions that allow to search across comment bodies in different ways, but I don't think that's what's needed.

There are 2 scenarios that could be happening:

* Either, your search query is flawed and could be done differently / more robustly; OR

* It isn't working because the comment bodies have not been indexed

 

More likely the first one, because if you were having problems with indexes, you'd likely notice that. Jira's relatively good on that part nowadays.

John Doe
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 2, 2024

Thanks for the reply.

The search I do is very simple, I simply make a filter by project (to limit the search).
I have tried searching by words or by exact phrase:

project = XXXXXXX AND comment ~ "Department23"

project = XXXXXXX AND comment ~ "\"Department23\""

 

Same result, only 2 tickets appear. Is it possible that the contains "~" is not completely reliable? Is there no other way to filter by comments?

Radek Dostál
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 2, 2024

It's reliable, but it has some caveats, can be a bit tricky sometimes to get it to work and I had some problems with it as well over the time, but it can be worked out.

I agree those queries seem simple (though I don't think adding quotes to the search term will help at all), then again I don't know what the comment you're expecting to find looks like.

It's not really a "contains" operator as they make it seem, it's more of a "contains words". You might find more luck by adding wildcards* to them, take a brief look here: https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/

Most notably the section about "word stemming".

 

Usually I can workaround some weird matches by adding a wildcard here and there.

 

On other ways to search, like I said, not out of box, you would need some apps/plugins installed that add new JQL functions. They don't(can't) add anything new to the "comment" field itself, plugins can only create new functions so they have their own specific JQL syntax. Still, I don't think you need anything custom. Those searches you show probably just need a bit of tweaking here and there. Adding wildcards is usually the easy way to do it.

(e.g. "Depart*23" or "Department23*", things like that; not intuitive but.. oh well that usually does the trick)

 

Suggest an answer

Log in or Sign up to answer