Advanced query (contains not !~) and comments

Hi,

I want to get all issues, which does not contain comments with a given word, e.g. no comment of a issue shall contain the word "Test".

Currently the search looks at every comment but not the whole comments of a issue. This means, if a issue has several comments, one does contain the word but one of the others does not, the issue gets displayed in the navigator.

All issues of project MYPROJ, which do not contain comments with the text "Test".

project = MYPROJ AND comment !~ Test ORDER BY key ASC

How do I write a query which matches all comments of a issue?

4 answers

1 accepted

This widget could not be displayed.

If I got you correct you want to select issues where all comments does not contain the word "Test".

Hmm, I think this can not be achieved with advanced JQL. As you mentioned as soon as you have in one comment "Test" the 'does not contain' condition becomes true.

Sorry

This widget could not be displayed.

How can i search for string not containing # character in comments. above solution is not valid here as # being reserved character in JQL

This widget could not be displayed.

This can be achieved by building two queries:

1) Build a query that gives you all tickets that contain your text "Test":

project = "MYPROJ"  AND comment ~ "test"

2) Save that query and note the filter id. We'll pretend the filter id is 1234

3) Reference that query to get the opposite of it:

project = "MYPROJ" AND filter != 1234

You mean

comment ~ "test"

instead of

project = "MYPROJ" AND comment ~ "test"

, right?

This widget could not be displayed.

Hi @Pat Cullen, I am trying to use your suggestion with two queries but getting error "causes a cyclical reference" when executing the second one. Specifically, I created this first query: 

type = "Enhancement Request" AND comment ~ housekeeping ORDER BY created ASC

Saved it with filter ID: 27613

Then use filter in second query:

type = "Enhancement Request" AND filter !=27613

 

I am trying to get all tickets without comment that includes the text" Housekeeping". Any help would be very much appreciated! 

Hi @Carolina Rodriguez,

The trick is to not use similar expressions in both (here it's the 'type' term), per @Florian K's message above.

If you save only this part as your first filter: 'comment ~ housekeeping'

then your second query should then work.

Mark

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

576 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you