text search with negation

I need to find all issues wich don't have such comment with text "bla bla bla" (for example)

this search query returns issues containing comment:

issue in linkedissues (Direct-34567) and comment ~ "bla bla bla"

But construction with negation doesn't :(
issue in linkedissues (Direct-34567) and comment !~ "bla bla bla"

Does anyone know why?

2 answers

That may be because you have other comments in those issues that do not include "bla bla bla". It seems like JIRA searches each comment individually, not all comments as one set of text. For example, take an issue with two comments:

comment 1: bla bla bla

comment 2: hello world

Comment 2 does not include bla bla bla, so the negated search will return the issue even though comment 1 does have bla bla bla in it.

Does that fit your situation?

Yes, this is possible.
Bot how can I cope with this?

Randalls explanation is correct. In order to achieve your goal you would need to negate the whole query to exlude those comments:

issue in linkedissues (Direct-34567) and not(issue in linkedissues (Direct-34567) and comment ~ "bla bla bla")

thx, but this one doesn't work either =(

issue in linkedissues (Direct-34567) - returns 147 issues.

issue in linkedissues (Direct-34567) and comment ~ "bla bla bla" - returns 104 issues

issue in linkedissues (Direct-34567) and not(issue in linkedissues (Direct-34567) and comment ~ "bla bla bla") - return all issues in the system

Now you made me curious. If you combine the clause which returns 147 issues with AND to a second clause (doesn't matter what clause) the combined result never can be more than 147 issues.

So, I guess the query you ran that gave you "all issues" contains an OR operator as well. Please post you complete query so we can help you.

Well, I cannot reproduce it now -_-

Here are screens of queries and results:

---------

And issue in linkedissues (Direct-21629) returns how many issues?

Hmm, I am confused. You got 149 issues which are linked to Direct-21629. Of those 149 you got 101 issues that have that particular cyrillic phrase in a comment.

So, if I take 'those 149 and not( those 101)' I'd expected 48 issues as the result. But there are 99 more!

I'm clueless. Actually this sounds like a bug to me.

Sorry, that I couldn't help you much.

I guess this is a bug too. Where I should write about it?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,232 views 14 19
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot