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.
Hello @Sam Rice
Move the second case between the brackets on the "Key In".
key IN (portfolioChildIssuesOf("ENG-1") OR key = "ENG-1")
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.