Searching Issues where comment field does not include text

Maria Del Rosario Gonzalez
Contributor
September 20, 2022

I am working on JIRA Cloud and would like to get a list of records where a certain comment does not appear.

This works perfectly when the JQL is comment ~ "String" but the opposite does not.  I have tried using comment !~ "String" or NOT (comment ~ "String") also single quotes around String.

Lastly, the String = Baseline so it does not have any special characters.

Many thanks in advance!

1 answer

1 accepted

2 votes
Answer accepted
Harald Seyr
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 20, 2022

Hi @Maria Del Rosario Gonzalez 

the search for "comment !~ String" or "NOT (comment ~ String)" probably does not work because JQL checks if any other comment exists that does not contain the text.

Since JQL does not support subqueries / subselects in a direct way, the only solution I can think of is a little complicated.

  • select the issues containing the text in comment, e.g. comment ~ String
  • save this as a filter, e.g. "MyCommentFilter"
  • select all issues not in the filter by JQL like "filter not in (MyCommentFilter)"

Please make sure that after saving the filter in second step, reset the search form not to show the "MyCommentFilter" anymore, otherwise Jira will display an obscure error message about cyclic dependencies.

Regards,

Harald

Maria Del Rosario Gonzalez
Contributor
September 21, 2022

Thanks Harald, this worked!  Much appreciate the prompt response!!

Amy
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!
May 10, 2024

Worked for me too, Thank You!!

Waqar Hasan Khan
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!
October 15, 2024

it works thanks 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events