How to filter for issues with subtasks?

SSchoepel March 30, 2015

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.

6 answers

0 votes
Randy Showalter April 13, 2021

What happens if a subtask is deleted?

0 votes
K Watkins October 23, 2015

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

0 votes
Shawn Thiel April 6, 2015

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!

0 votes
Shawn Thiel April 6, 2015

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

SSchoepel April 6, 2015

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.

0 votes
SSchoepel March 31, 2015

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.

 

Udo Brand
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.
March 31, 2015

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!

0 votes
Udo Brand
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.
March 30, 2015

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?

Suggest an answer

Log in or Sign up to answer