Query to pull User Stories with Sub-tasks status

bravedj October 7, 2020

Greetings all!

Need some more help plz. I am trying to get the list of User Stories with "Sub-tasks status in (Done, Cancelled)". So it should pull only the count of User stories where the sub-tasks status in either Done or Cancelled.

am using below query, but doesn't pull anything.

project = JIRA AND "Epic Link" = JIRA-1 and issuetype = story and issueFunction in hasSubtasks() and (issueFunction in subtasksOf("status in (Done, Cancelled)"))

can you please help?

3 answers

1 accepted

1 vote
Answer accepted
bravedj October 7, 2020

Got the answer!

project = Jira and "Epic Link" = Jira-1 and type = Story and not issuefunction in parentsOf("status != Done and status !=Cancelled") and issueFunction in hasSubtasks()

Ray April 25, 2024

How would you do this to find uassigned subtasks within a story?

0 votes
Fazila Ashraf
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 7, 2020

@bravedj  , if you are interested on returning the stories only, then you should use parentsOf instead of subtasksOf

That would return the parents (i.e., stories) where the subtasks are in the given status

bravedj October 7, 2020

Thanks Fazila, yes parentsOf worked. thank you. plz see my exact query below.

Like Bhanu Moorthy likes this
Afrida Islam March 29, 2023

Hey, I am tring to retrun the Subtasks in this case what to do?
I am struggling in filtering all the Subtasks != Done but their parent Stories = Done.

Nicole Downes July 5, 2023

In Jira cloud, the following is available without Scriptrunner:

  • Find issues and sub-tasks in the epic DEMO-123:
    parentEpic = DEMO 123
  • Find issues and sub-tasks in the epic DEMO-1 or SAMPLE-4:
    parentEpic in (DEMO-1, SAMPLE-4)

For other advanced search options go to Advanced search reference - JQL functions | Jira Work Management Cloud | Atlassian Support

Suggest an answer

Log in or Sign up to answer