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

Count of SubTasks in JQL

We are trying to filter all Stories (type = Story) with no subtasks. Those stories need extra time to define before we can start working on them. I'm looking for a way to create a field with the number of subtasks for a certain task (Epic, Story, ...).

Is this possible? Does this already exist?

Thanks in advance,

Maarten Cautreels

4 answers

1 accepted

1 vote
Answer accepted

OnDemand tough :(

Otherwise our famous Script Runner would have helped you to write a simple scripted field.

Indeed! It could also be done with the jql functions in script runner:

issuetype = "Story" and issueFunction not in hasSubtasks()

This does not work. It is showing all stories with subtasks and no sub-tasks together

0 votes

Thanks for the answers. I hope something gets implemented in the future. Or the Script Runner should become available on OnDemand instances!

Sorry for necro'ing a old thread, was following a link from another issue. But the information is relevant now if someone finds this via search.

What you can do, is add a post function to the subtask creation to update a value on the parent ticket. JSU can do this and is available cloud.

Have a field called "Subtask Present" that is normally empty. Add a post function to the subtask create to set the parent "Subtask Present" field to "True"

Bet you could also do something with Automation for Jira. (also in cloud) Again, on subtask creation.

Actually, you could even do it on a scheduled basis to catch your existing ones. They have a related condition "if subtasks are present". So this would be trivial. :)

Making it give you a count might be a little trickier, (Doing some math with "smart values" maybe, but not sure its possible)  but setting a fixed true/false value is easy

Suggest an answer

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

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

344 views 1 3
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