Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Scriptrunner JQL for all issues and sub-tasks for an Epic

Stu
Contributor
May 15, 2019

Sorry if this has been asked many times before, but previous answers aren't working for me.

I have Scriptrunner installed, and would like the JQL to return all my issues and subtasks of those issues for a particular Epic.

 

Many thanks :)

2 answers

2 votes
Brian Spence
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.
February 27, 2020

I believe this is what Gezim is suggesting, but the basic JQL to return all the issues in a set of Epics, along with the sub tasks of those issues would look like:

 

issueFunction in issuesInEpics("key in (EPIC-12345, EPIC-67890)") OR issueFunction in subtasksOf("'Epic Link' in (EPIC-12345, EPIC-67890)")

 

Just insert your Epic keys for the italics text.

The Adaptavist recommendation involves creating two filters, but I find it easier to do it all in one.  

2 votes
Gezim Shehu [Communardo]
Community Champion
May 16, 2019

Hi,

 

You can use this:

issueFunction in issuesInEpics("labels in (AWS)")

 

issuesInEpics - returns all issues of epics in subquery ().

In my case I searched for all epics containing the label AWS, but you can simply replace that with the issue key only for 1 Epic.

 

Cheers

Stu
Contributor
May 19, 2019

Hi i tried this...

issueFunction in issuesInEpics("ICS-526")

Where ICS-525 is the epic that I want to get the issues and sub-issues for.  It didn't work.  I think I'm missing some jql.

Just to confirm, does your script above include the issues, as well as the issue sub-tasks?

Thanks

Gezim Shehu [Communardo]
Community Champion
May 20, 2019

You would have to also add

issueFunction in subtasksOf(....)


Subtasks of issues have no information if issue is related to an epic or not. The subtask can be related though

Gezim Shehu [Communardo]
Community Champion
May 22, 2019

Kindly mark as accepted, if it solved your issue.

Suggest an answer

Log in or Sign up to answer