It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.



2 answers

2 accepted

1 vote
Answer accepted

Hi @Emily Mason 
If you have scriptrunner, you could use "subtasksOf" in your jql.


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

That jql returns the subtasks.

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

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

Like pargab sala likes this

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. 

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")

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

No problem, have a nice day

0 votes
Answer accepted

script runner is helpful here

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Agile

Overview of Advanced Roadmaps UI + Get started with Automation for Jira - Demo Den September 2020

Deliver better and faster value to your customers with the Jira automation platform. Watch this Demo Den series below to learn how to use the new interface and set up automation rules to help your te...

1,302 views 3 6
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you