Forums

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

comment ~ "text" matches a ticket, but comment !~ "text" does not hide the same ticket

Frank Salmick
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!
September 10, 2020

I have a ticket with the comment "custom note I wrote". Although it has multiple comments, one of the comments is just this string. I use this filter to find only this ticket:

comment ~ "custom note I wrote"

And only the ticket with "custom note I wrote" shows up.

 

However, when I negate the search:

comment !~"custom note I wrote"

All tickets are returned, including the ticket with this comment! This is not a simplified version of the query I'm running (there are no other conditions in the query).

 

I solved this by creating a filter called hide helper with this query:

comment ~ "custom note I wrote"

 

Then, I created this filter:

filter != "hide helper"

Which returns all the tickets except the one with "custom note I wrote". This is the behavior I expected from the original negated search (comment !~"custom note I wrote")

 

This is a fine solution, but I'm very curious as to why negating it doesn't work like I expect. My first thought was that I'm missing a wildcard or something, but since the ticket is returned in the original query (comment ~ "custom note I wrote") I don't believe this is the case.

1 answer

0 votes
Michael Andolfatto
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.
September 10, 2020

Hi @Frank Salmick , welcome to the Community!

It's interesting- the query comment !~ "custom note" should indeed fail if there is more than one comment on that particular issue (because it's looking at all comments - more here)

I assume the filter != "hide helper" query works, because the hide helper filter is first isolating the issue by using a query which does work (comment ~ "custom note") and then returning issues that are not targeted by this filter.

Suggest an answer

Log in or Sign up to answer