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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,760 views 11 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot