Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Advance search showing too many results

Paul Ballard
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 21, 2020

Hi, im trying to list all 'open', 'in progress' or 'to do' jiras that were raised by specific users, under a a few projects.
However the attempts I make using the advance search always shows more then the required Jira (for example 'closed' jiras) Even if I exclude these from the search using the AND status =! closed

Any help would be great..

Here is the search im using...

Project in ("PITstop Bugs", "Business Merlin - Not Prioritised", "PITstop Merlin & Web") AND issuetype in (bug, story, spike, "Change Requests") AND reporter = Harry.Heiskanen OR reporter = Paul.Ballard AND status = "To Do"

 

 

 

 

 

 

3 answers

2 accepted

0 votes
Answer accepted
Anton_Ermolaev
Contributor
January 21, 2020

if you use only 'open', 'in progress', 'to do' and 'closed' statuses in your workflow, than your JQL would be something like that:

Project in ("PITstop Bugs", "Business Merlin - Not Prioritised", "PITstop Merlin & Web") AND issuetype in (bug, story, spike, "Change Requests") AND reporter in (Paul.Ballard,Harry.Heiskanen) AND status =! Closed

0 votes
Answer accepted
Ravya
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 21, 2020

Hi @Paul Ballard ,

Welcome to Atlassian Community!

Try this JQL, may be it will help:

Project in ("PITstop Bugs", "Business Merlin - Not Prioritised", "PITstop Merlin & Web") AND issuetype in (bug, story, spike, "Change Requests") AND reporter in ("Paul.Ballard",Harry.Heiskanen") AND status = "To Do"

--Ravya

2 votes
Max Foerster - K15t
Community Champion
January 21, 2020

Hi Paul,

For the sake of completeness, it is important to say that OR in JQL is tricky and should always be used with parentheses. Standing on its own the query will be interpreted as "everything before the OR" and "everything after the OR". That means your query returns results for:

1. Project in ("PITstop Bugs", "Business Merlin - Not Prioritised", "PITstop Merlin & Web") AND issuetype in (bug, story, spike, "Change Requests") AND reporter = Harry.Heiskanen

AND

2. reporter = Paul.Ballard AND status = "To Do"

@Anton_Ermolaev and @Ravya  solved this by using the IN operator for the usernames. It works like (reporter = Paul.Ballard OR reporter Harry.Heiskanen), please note the parenthesis. :)

So your initial query wasn't that far off the correct one with added parenthesis:

Project IN ("PITstop Bugs", "Business Merlin - Not Prioritised", "PITstop Merlin & Web") AND issuetype IN (bug, story, spike, "Change Requests") AND (reporter = Harry.Heiskanen OR reporter = Paul.Ballard) AND status = "To Do"

Best, Max

Anton_Ermolaev
Contributor
January 21, 2020

@Max Foerster - K15t  good advice about parentheses, AND and OR.

@Paul Ballard read https://confluence.atlassian.com/jirasoftwarecloud/advanced-searching-keywords-reference-764478340.html about it. Unfortunately, I can't remember the article about keyword AND (priority AND over OR in JQL), so see the example:

1) JQL: project = ABC and reporter = John or reporter=Mike

find issues:

- John's issue from project ABC 

- and Mike's issue in any project

2) JQL: reporter=Mike or project = ABC and reporter = John 

find the same issues!

- John's issue from project ABC 

- and Mike's issue in any project

3) ant then JQL: project = ABC and (reporter = John or reporter=Mike)

find issues where

- John's issue from project ABC 

- and Mike's issue from project ABC 

 

 May the force be with you. Force of parentheses

Suggest an answer

Log in or Sign up to answer