JQL to retrieve all stories and sub tasks related to specific epic
<p>Is it possible to use raw JQL (not using any plugins) to filter for ALL stories AND their respective sub-tasks?</p>

<p>Currently, I have the following which successfully retrieves all stories for EPIC-123:</p>

<pre><code>project = PROJ1 AND "Epic Link" = EPIC-123 AND issuetype = Story ORDER BY priority DESC, updated DESC
</code></pre>

<p>However, I also want the sub-tasks related to those stories. So I thought this would work:</p>

<pre><code>project = PROJ1 AND "Epic Link" = EPIC-123 AND (issuetype = Story OR issuetype = Sub-task) ORDER BY priority DESC, updated DESC
</code></pre>

<p>But this only returns the stories. </p>

<p>I think this is because JIRA reads this as "Retrieve sub-tasks for EPIC-123" (which is 0) as opposed to "Retrieve sub-tasks for stories in EPIC-123".</p>

<p>I also thought about using 
<code>issue in (linkedIssues(AAA-###)</code>) but I imagine this will involve programatically looping through all the stories that are returned in the above query. Which seems ridiculous and probably not possible.</p>

<p>Would rather not go down a plugin path but open to suggestions. Thanks!</p>