Forums

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

Why does adding an "OR" condition ignore the rest of my JQL?

Sam Rice June 9, 2025

I have some fairly simple JQL that is behaving strangely and I can't figure out why. We have Initiative work items set to be parents of Epics, which are parents of Tasks and Stories.

I'm trying to create a filter that grabs an initiative and all its children. When I do something like this, where ENG-1 is a parent initiative with many children:

key IN (portfolioChildIssuesOf("ENG-1"))

I get returned a large quantity of work items. But when I try to include the top-level initiative ticket with something like:

key IN (portfolioChildIssuesOf("ENG-1")) OR key = "ENG-1"

the query returns ONLY ENG-1.

It's an OR condition - so shouldn't it be applying both conditions? 

EDIT: An interesting wrinkle.... 

key IN(portfolioChildIssuesOf("ENG-1")) OR issuekey IN("ENG-1")

Returns both all child issues of ENG-1 and ENG-1 itself as expected. However, when I use ONLY either "key" or "issuekey" instead of mixing them, I get back only ENG-1.

I am starting to think this may be a bug.

1 answer

0 votes
arielei
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.
June 9, 2025

Hello @Sam Rice 

Move the second case between the brackets on the "Key In".

 

key IN (portfolioChildIssuesOf("ENG-1") OR key = "ENG-1") 

 

 

Sam Rice June 10, 2025

Hi @arielei -  portfolioChildIssuesOf() returns a set of issue keys and "key = ENG-1" returns a boolean value. Per the docs, I don't think that's how the IN operator is meant to be used. I tried it just to be sure, but that also returns the JQL error I would expect:

Expecting ')' or ',' but got 'OR'. (line 1, character 43)
arielei
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.
June 10, 2025

hello @Sam Rice 

i tried your JQL and it works.

 

key IN (portfolioChildIssuesOf("ACC-5139")) OR key = ACC-5139

returns all child work-items of ACC-5139 and also ACC-5139 work-item. 

Sam Rice June 10, 2025

Yeah, I think this in addition to my edit make it seem like there's either a bug or some kind of very weird setting in our environment causing this. Thanks for the follow up!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events