How to filter for issues with subtasks?

This is an answer rather than a question.

I'm in the Cloud and I need a way to see issues that do not have subtasks, for a set of specific parent and subtask issue types. There is no nice way to use the out-of-the-box filtering or plugins in the Cloud to find issues with subtasks. 

What I did:

  1. Created a "hasSubtasks" custom number field. (Do not add it to anything, it doesn't need to be visible.)
  2. Added a post function to the Open transition for the subtask workflow to increment hasSubtask by 1.
  3. Added a post function to the Open translation for the subtask workflow to copy the value to the parent issue.
  4. Filter on issues where hasSubtasks is not empty or as a specific value (sometimes I want to see if there is more than one subtask).

It's simple but it works for me. Hope it meets someone else's needs, too.

 

Cheers.

5 answers

Good "question". Just one point. How do you search for issues with more than 1 subtask. As I understand this if you create two subtasks each of them has in "hasSubtasks" the value 1. And this value is copied twice to the parent (but the second copy overwrites the first one), so the parent has value 1 in that field, or?

You're correct. I forgot a step in my explanation.

2a. Add a post function to copy the parent hasSubtask value to the subtask.

2b. Add a post function to increment the hasSubtask by 1.

 

Ah, ok. Before you increment the value in your subtask, you first copy it from your parent, and after incrementing the value of the subtask it will be copied back to the parent. Smart!

Is there any way you can attach a screen shot of what the filter produces?

Also, what made you create this solution?  

I have issues grouping our subtasks with the parent.  As everyone knows, when you create the subtask it uses the next number sequence and does not associate that subtask to the parent number.  example - parent ticket PROJ-89 with subtasks tickets of PROJ-124, PROJ-138, PROJ-139.

It would be nice if it would truncate the parent number for the subtask - example - parent ticket PROJ-89 with subtasks tickets of PROJ-89.1, PROJ-89.2, PROJ-89.3

What made me want to do it was that we had no way of knowing if we had assigned subtasks. One of the issue types we have is a document issue. We have a subtask approval/rejection workflow for those issues. It's possible for someone to set document (parent) issue to "ready to approve" but not have added the approval (child) subtasks for each person to do their approval. (For example, you would add a separate document approval subtask and individual assignee for each person who should sign off on the document.) Rather than clicking on every issue that is ready to approve to see if it has child approval subtasks, I can see it easily based on the subtask count. I can also see if it doesn't have enough subtasks, meaning the didn't assign the requisite number of approvers. Regarding your other idea of the parent-child tasks having linked numbering, this really isn't an issue for us right now but I can see lots of reasons it would be helpful to other things I'd like to do with JIRA in the future.

Sigrid - Thank you for the quick response and reasoning for your changes.  The explanation leads to many additional thoughts on my side of what we could be doing with JIRA for our organization.  I have place this information on my list of follow ups and business model modifications.  

 

Thank you again!

Sigrid - just what I was looking for, thank you!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

64 views 0 5
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you