Jira Advanced Query for searching text in a comment field in a ticket does not appear to work.

steve laflen January 3, 2014

How can I get this query to work for my team? Comment!~ "success couponscom-integration"

I trying to display only tickets that do not have the comment 'success couponscom-integration'

Using Comment ~ seems to work just fine but the Comment!~ does not appear to catch it all. I'd like to use this on my rapidboard to see which stories and bugs have not been merged to integration or release.

3 answers

3 votes
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 3, 2014

Hi Steve,

If you search by comment, the JQL query will only search for those issues which have been commented on, which means that all the issues without comments will be ignored.

And please note that the query comment !~ 'success couponscom-integration' is not a negation of comment ~ 'success couponscom-integration'. For example, if an issue has 2 comments, 1 with the phrase 'success couponscom-integration' and 1 without, both of the above queries will include this issue in the search result, because:

  • the ~ operator matches the comment which contains the phrase
  • the !~ operator matches the comment which does not contain the phrase

My suggestion in this case is to try installing JIRA Toolkit plugin. It provides several custom fields that may help you extend your JQL. These potentially useful custom fields include:

  • last commented by
  • days since last comment
  • last public comment date
  • number of comments

All the best,

Andy

Udo Brand
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.
January 5, 2014

You are correct Andy, so a solution would be to create a filter that shows issue which contains "success couponscom-integration" and then simply negate that filter

Filter1 is: comment ~ "\"success couponscom-integration\""

and then use

not filter = filter1

Like Darren Giles likes this
Andy Nguyen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 11, 2014

Hi Udo,

Have you tested this on your side? I'm afraid this will cause a cyclical reference error owing to the nature of comment field to search for all comments in every issue (as I mentioned earlier ~ cannot negate !~). For more information, kindly have a look at this: Non-consistent cyclical reference handling in JQL.

Cheers,

Andy

Udo Brand
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.
January 11, 2014

Hi Andy,

yes, it is working.

Cheers, Udo

0 votes
Udo Brand
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.
January 3, 2014

Have you tried

comment !~ "\success couponscom-integration\""

Since you are searching for a phrase see also https://confluence.atlassian.com/display/JIRA/Advanced+Searching#AdvancedSearching-Comments

steve laflen January 9, 2014

thanks all for the replies. I'll try these and see what we get.

Suggest an answer

Log in or Sign up to answer