How to create a filter where it returns all sub-tasks that a parent story has xyz

Emily Mason September 15, 2020

This is what I am trying to create a filter for:

  1. Project = X
  2. Story has a field Y with value of "US"
  3. In the board, I would like a filter that returns all sub-tasks with a parent story that has #2 above. 

Work around is I put "US" in all the sub-tasks but I want to avoid that and pull based on stories that have "US" in them.

 

Thanks! 

2 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Gustavo Félix
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.
September 16, 2020

Hi @Emily Mason 
If you have scriptrunner, you could use "subtasksOf" in your jql.
https://scriptrunner-docs.connect.adaptavist.com/jiracloud/enhanced-search.html#_subtasks

e.g.

issueFunction in subtasksOf("project=XXXX and yourField = XXX ") 

That jql returns the subtasks.

Emily Mason September 16, 2020

Thank you. Is there a way to do this without script runner?

Gustavo Félix
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.
September 16, 2020

Not to my knowledge.
There are others plugins of course, but I dont think is doable without one.

Like pargab sala likes this
Emily Mason September 22, 2020

thank you. I installed script runner. 

The JQL query I used is:

issueFunction in subtasksOf("Project = S2AGT and Service Provider-BI = US")

But I got this error:

  • Error in scripted function: subtasksOf, see below
  • Error in the JQL Query: Expecting operator but got 'Provider-BI'. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 29)

The parent story has service provider-BI = US populated and I want to pull the sub-tasks that contain this US value in the story. The sub-task doesn't have US populated so trying to avoid populating the US to all sub-tasks. 

Gustavo Félix
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.
September 22, 2020

I think the problem is that you have to put inside ' ' your custom field. 
Any of this two options should work.

1)issueFunction in subtasksOf("Project = S2AGT and 'Service Provider-BI' = US")
2)issueFunction in subtasksOf("Project = S2AGT and 'Service Provider-BI' ~ US")

Emily Mason September 22, 2020

The second one did the trick Gustavo. Thank you so much for saving me hours to look into a solution. Have a great day!

Gustavo Félix
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.
September 22, 2020

No problem, have a nice day

0 votes
Answer accepted
pargab sala September 18, 2020

script runner is helpful here

TAGS
AUG Leaders

Atlassian Community Events