Forums

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

What is wrong with this query

Bonnie Lopes February 27, 2020

project = MOM AND component = "D. Delivery excellence (governance & risk)" and (issueFunction in issuesInEpics (Component in ('D. Delivery excellence (governance & risk)'))) or issueFunction in subtasksOf("issueFunction in issuesInEpics(component ="D. Delivery excellence (governance & risk)")) ORDER BY "Epic Link" , key DESC

 

I am trying to return all issues with they subtasks, by epic, for project: MOM and Component: D. Delivery excellence (governance & risk)

1 answer

1 accepted

4 votes
Answer accepted
Parvaneh Zand
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.
February 27, 2020

Hi @Bonnie Lopes ,

first part (before OR) is true, but you should remove component = ... , because the query contains it's name.

second part is actually trying to get the subtasks of the first part,

so I saved this query as a Filter (e.g. Filter = issues)

issueFunction in issuesInEpics(Component in ('D. Delivery excellence (governance & risk)'))

then I used this Filter in JQL : 


project = MOM AND ((issueFunction in issuesInEpics(Component in ('D. Delivery excellence (governance & risk)'))) or (issueFunction in subtasksOf("Filter = issues"))) ORDER BY "Epic Link" , key DESC

 

wonga
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!
February 28, 2020

Struggled with a similar JQL yesterday had to understand the in instead of =

Parvaneh Zand
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.
February 28, 2020

When you know the exact value of a field, use '=',

 issuetype = Task

otherwise use 'in' to search within multiple specified values or sub-queries.

issuetype in (Task,Story)

or

issueFunction in hasSubtasks()

which provides all the issues with sub-tasks.

Bonnie Lopes February 28, 2020

First I want to say thank you for the responses, this is a critical ask of me and I just can't seem to get the syntax correct.

Tried creating the first filter as suggested: issueFunction in issuesInEpics(Component in ('D. Delivery excellence (governance & risk)')) and received this syntax error: Error in the JQL Query: Expecting ')' or ',' but got 'in'. (line 1, character 42), which is the same error I was getting.

Tried changing to use = instead of in, but received the same error in the same place: Error in the JQL Query: Expecting ')' or ',' but got '='. (line 1, character 42)

 

Couldn't even try the second part as I could not get the first query to save

Bonnie Lopes February 28, 2020

to recap, what I am trying to do.

I am trying to get for a given component, all the epics and within the epics all the related issues to the epic, then all the related subtasks to any issue, so I can have a hierarchy representation of work within a component.

Parvaneh Zand
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.
February 29, 2020

for those errors, just put double quotation marks inside the parentheses, and also put component name inside single quotations. 

component = X

Filter = issues (fisrt line below)

issueFunction in issuesInEpics("component = 'X'")

OR issueFunction in subtasksOf("Filter = issues")

OR issueFunction in epicsOf("component = 'X'")
Bonnie Lopes February 29, 2020

Thank you for getting past the syntax error. My filter is just as you have above 1...Yay!

I am getting results just not grouped they way I wanted in the results:

I was looking for the results to be:

Epic 1

  Story 1 under epic 1

  Story 2 under epic 1

    Sub-task under story 2

Epic 2

  Story 3 under epic 2

    Sub-task under Story 3

  Story 4

Bonnie Lopes March 9, 2020

found out that this is not possible except perhaps with a structure plug-in

Like Parvaneh Zand likes this

Suggest an answer

Log in or Sign up to answer