How to filter for certain issue-type with Sub-Tasks in them. Edited

Hi,

Thanks in advance. I would like know if anyone has an JQL to search for all the Stories but list only those which has sub-tasks associated with them.

 

Best,

Rathna

4 answers

1 accepted

1 votes

This is not possible by default in JIRA. You will need a plugin like JQL Tricks. With JQL Tricks, you will do:

issue in hasSubtasks()

You can find similar plugins for server and cloud JIRA in the marketplace.

0 votes
Alexey Matveev Community Champion Jan 06, 2018

Hello,

You would need an add-on as Jobin said. There are multiple add-ons on the marketplace. You could use JQL Tricks, Adaptivist ScriptRunner or Power Scripts.

If you were on Jira Server/Data Center and you had the Power Scripts add-on, you could write your own JQL function. You would need to create a script file called hasSubTasks.sil with a code like this

string [] keys = selectIssues(argv[0]);
string [] ret;
for(string k in keys) {
   if (size(subtasks(k)) > 0) {
         ret += k;
   }
    
}
return ret;

Then you could use this function during search like this:

key in silJQLList("hasSubTasks.sil", "project = SCRUM")

You can change the script file to comply to any logic you need. You can find more information on the Power Scripts add-on here:

https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.jjupin/server/overview

Just another thought on the solution to your question.

Hi,

you can check our Epic Finder add-on, please take a look here:

  • User Guide - you will find here all functions
  • Ultimate Guide - you will find examples of use and use cases for these functions.

Function that may help you is efEmptyStories:

issue not in efEmptyStories("project = TEST") and issuetype = Story

You can find more information about Epic Finder add-on here.

Best regards,

Lime Trees Support Team

Hi,

First off thanks ( Jobin Kuruvilla, & Alexey Matveev) for your responses.

My Apologies, that I have not mentioned that I was using script runner plugin. I found the below code and it worked.

issuetype = Epic and issueFunction in hasSubtasks()

 

Posting this so that someone can find it useful.

Best,

Rathna.

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,934 views 12 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