Filter for the existence of comments on issues

michaelfanderson
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!
November 12, 2017

I would like to write a filter that will return any issues that have comments. The only option in JQL I've seen related to comments is the Tilde (~) which I believe indicates "contains."  However, I want to find all issues with comments, not just those, and I don't know how I can do that with ~ because I can't know what the comments might contain. I tried " ", but Jira didn't like the empty string operator.

Any ideas would be appreciated.

Thank you.

Michael Anderson

 

 

 

 

 

 

4 answers

12 votes
Pavel Konstantinov
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!
December 9, 2021

I came up with the following workaround  - add the following as a part of your query:

(comment ~ "anything*" OR comment !~ "anything*")

Keren Rachev April 11, 2022

That was really helpful, thanks!

Ioana Sundius October 31, 2022

clever!

Abdiel Martínez
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!
March 17, 2023

Me funcionó, gracias

Kat Markava
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!
April 5, 2023

Thanks! Helped!

Martijn van de Locht
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!
January 11, 2024

First of all, thanks for this! I know this is an old topic, but I couldn't find the answer to this anywhere else: Is there a way to get the inverse result (issues without comments) in a similar fashion (without app or plugin)? Thanks again.

Edit: For those who come after me, I did manage to find the solution here: How to setup a filter that shows tickets with no responses.

Calebe Garcia February 23, 2024

Obrigado, foi muito útil!

 

------

Tanks, It was very useful!

3 votes
Daniel Turczanski - __JQL Search Extensions
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 18, 2017

Hi Michael,

JQL Search Extensions adds a bunch of keywords for comments. After installing the plugin you can then use the following JQL:

commentsCount > 0 

Full documentation is here.

0 votes
Joanna Plaskonka November 13, 2017

Hello,

There are already some answers which might be interesting for you:

https://community.atlassian.com/t5/Jira-questions/How-to-find-issues-which-does-not-have-a-comment/qaq-p/402636

https://community.atlassian.com/t5/Jira-questions/How-to-search-for-JIRAs-which-have-no-comment/qaq-p/292185

Look for example at Jira Toolkit Plugin and create custom field 'Number of comments'. 

0 votes
Alexey Matveev
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.
November 12, 2017

Hello,

you could write such a filter if you have Adaptivist Scriptrunner installed. This plugin has "hasComments" JQL function. You can read more here about this function:

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_hascomments

Suggest an answer

Log in or Sign up to answer