Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to limit a JQL search to return one Issuetype.

This seems really simple and I think I have even done this before although it was probably the other way around where I was trying to find more than one issuetype. I'm working in Cloud. My search is this:

project in (EAM, MFG) AND "Applicable Project" = Gryphon19 OR labels in (Gryphon-19, Gryphon19, Strato-Radar) AND issuetype not in (Sub-task, Epic) AND status = Done ORDER BY key ASC, created DESC

Both this search and using issuetype = Task returns both Tasks and Sub-tasks but surprisingly not Epics which also exist.

Something I noticed with JQL this time that seems to make a difference in my results is the order of placement of the individual queries within the whole search function. I'm now wondering if there are guidelines for the order of operation.

2 answers

2 accepted

1 vote
Answer accepted

It's down to the way the and and or operators work - I suspect your query is not joining the clauses in the way you think it is.  And is pretty obvious - X and Y and Z does what you think, but when used alongside an and, OR becomes tricky - X and (Y or Z) is not the same as (X and Y) or Z.

Try these to see how the OR is doing things differently to the way you think:

( project in (EAM, MFG) AND "Applicable Project" = Gryphon19 ) OR (labels in (Gryphon-19, Gryphon19, Strato-Radar) AND issuetype not in (Sub-task, Epic) AND status = Done ) ORDER BY key ASC, created DESC

( project in (EAM, MFG) AND "Applicable Project" = Gryphon19 ) OR (labels in (Gryphon-19, Gryphon19, Strato-Radar) ) AND issuetype not in (Sub-task, Epic) AND status = Done ORDER BY key ASC, created DESC

Nic, you are the man. I think I see now how the order of operation of the search is critical. Cast the widest net first, then limit the filter in order of item needed. And I never even thought about using nested parenthesis in my search function. I will do some testing and see what I get.

It is, and I can never remember how Or and And combine!.  Note that in my answer I completely dodged saying how they were interacting.

I cheat and always stick brackets around every combination, just so I can be sure I know what it is doing!

LOL, somehow Nic I find it hard to believe you have trouble with OR & AND given how often I see your posts here in the community.

I'm really an engineering technician and not a software guy by trade except for LabVIEW. I had Jira brought in by someone else based on the recommendation of someone who is no longer here, and then had a "Jira expert" (read intern) set up a bunch of stuff w/o following good practices that I now have to clean up and manage. It's been eye-opening, to say the least, but after going through some online training I have been able to get a reasonable handle on things. I now get to struggle alongside my old school VP with learning agile/lean management.

0 votes
Answer accepted

Hi @Danno ,

In your query the OR operator is not grouped so your search returns concatenation of below 2 sets

  1. project in (EAM, MFG) AND "Applicable Project" = Gryphon19 AND issuetype not in (Sub-task, Epic) AND status = Done
  2. labels in (Gryphon-19, Gryphon19, Strato-Radar)

You should put the OR into parenthesis as below.

project in (EAM, MFG) AND ("Applicable Project" = Gryphon19 OR labels in (Gryphon-19, Gryphon19, Strato-Radar)) AND issuetype not in (Sub-task, Epic) AND status = Done ORDER BY key ASC, created DESC

Hi Bloompeak,

Thanks for the confirmation of the use of parentheses. I had read Nic's reply and had started a reply to him which I didn't send because I went off to try some quick changes to my search and see what the results were. I got interrupted and started doing something else altogether and then had to reboot my laptop and lost my response.

Suffice it to say I read Nic's reply which gave me the biggest clue that order of operation was critical. Here is my corrected search:

project in (EAM, MFG) AND issuetype in standardissuetypes() AND status in (Done, Closed, Complete) AND ("Applicable Project" = Gryphon19 OR labels in (Gryphon-19, Gryphon19, Strato-Radar)) ORDER BY key DESC, created DESC

This is what finally got me the results I wanted w/o the extra subtasks and Epics mixed in. It became quite clear that I was reeling those issue types into my net first and I didn't realize that you can't exclude them once they are in there. Another problem was I was trying to find the right combination of search items to use given I was digging through two completely different projects (One Next-Gen and one Core Business Project) with people using all kinds of labels and statuses as well as items that are resolved vs. unresolved.

Thank you @Nic and @Bloompeak Support for your help. I am still a real newbie with administering our entire Jira system which is a real WIld West show where we had multiple people creating their own way of doing things.

Consider it answered.

Like Bloompeak Support likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

326 views 9 7
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you