List all tasks under user stories that are under epic

Structure is:

Epic -> user stories -> tasks or bugs 

How can I list all tasks / bugs that belong to 2 or more epics.

2 answers

1 accepted

This widget could not be displayed.
Mikael Sandberg Community Champion Oct 04, 2017

You could either search for all issues that have the epics in question in epic link, but you would have to manually enter the keys for the epics (if you are linking your tasks/bugs to the epic). Another option is to use an app, ScriptRunner and JQL Tricks can be used for nested JQLs.

I have scriptrunner but I have never used it.
Can you give me an example?
Lets say I have epic-123 which has 3 user stories and under each user story are 5 tasks. So I need to get a list of those 15 tasks.

Mikael Sandberg Community Champion Oct 11, 2017

To do it in ScriptRunner you would have to create a filter that gets the stories associated with the epic, something like this:

issuesInEpics("issuekey = epic-123")

Save that filter (in the example the filter is named Stories in Epic), and then use it in another query:

filter = 'Stories in Epic' or issueFunction in linkedIssuesOf("filter = 'Stories in Epic'")
This widget could not be displayed.

Hi Olafur,

I do not know how in ScriptRunner but if helpful you can do this using the Power Scripts add-on.

There is a video tutorial walking you through in detail here.

The code is simple:

string [] tasks;
string [] stories;
string [] epics = selectIssues("issueType = 'Epic' AND project = " + argv[0]);
for(string e in epics) {
    string [] stry = allLinkedIssues(e, "Epic-Story Link");
    for(string s in stry) {
        string [] tsk = allLinkedIssues(s, "jira_subtask_link", 1);
        tasks += tsk;
    stories += stry;
string [] results;
results = arrayUnion(epics, stories);
results = arrayUnion(results, tasks);
return results;

Hope this helps!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

146 views 2 0
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