Count of SubTasks in JQL

Maarten Cautreels
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.
January 13, 2013

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
Renjith Pillai
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.
January 13, 2013

OnDemand tough :(

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

0 votes
Andrew Laden
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 24, 2019

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

0 votes
Maarten Cautreels
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.
January 14, 2013

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

0 votes
JamieA
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.
January 13, 2013

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

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

Phaneesh C Gopisetty September 24, 2019

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

Suggest an answer

Log in or Sign up to answer