text search with negation

Lena Fedoseeva August 16, 2013

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

1 vote
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.
August 16, 2013

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")

Lena Fedoseeva August 17, 2013

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

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.
August 17, 2013

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.

Lena Fedoseeva August 17, 2013

Well, I cannot reproduce it now -_-

Here are screens of queries and results:

---------

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.
August 17, 2013

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

Lena Fedoseeva August 17, 2013

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.
August 17, 2013

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.

Lena Fedoseeva August 18, 2013

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

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.
August 18, 2013
Lena Fedoseeva August 18, 2013

thnx!

1 vote
Randall Robertson
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.
August 16, 2013

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?

Lena Fedoseeva August 16, 2013

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

Suggest an answer

Log in or Sign up to answer