Forums

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

JQL to list all stories whose parent Epic got a fixVersion

Troy
Contributor
July 17, 2023

Hi, hope everyone doing well.

Need some help constructing a JQL that will fetch me all User stories whose parent Epic got the fixVersion populated as say V1.

3 answers

1 accepted

1 vote
Answer accepted
Vikrant Yadav
Community Champion
July 17, 2023

Hi @Troy  With the help of Script runner Enhanced search you can get all issues of an Epic which is having fixversion not Empty or fix version = V1. 

Atlassian provided JQL function won't have this option. 

 

issueFunction in issuesInEpics("project = PA AND fixVersion IS NOT EMPTY")

https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-enhanced-search/jql-functions#issuesinepics 

Troy
Contributor
July 17, 2023

@Vikrant Yadav Thanks for clarifying that this cannot be achieved via out-of-the-box JQL functions and will require a plugin from Marketplace like the one you mentioned.

Like Vikrant Yadav likes this
Vikrant Yadav
Community Champion
July 17, 2023

Yeah @Troy Without plugin it can't be achieved. 

Vikrant Yadav
Community Champion
July 17, 2023

Hi @Troy ,

Without plugin, you can achieve this using Project Automation. 

Create Manual or Scheduled trigger flow, use JQL fixversion IS NOT Empty AND issuetype = "Epic" and add Branch Select "Stories" in type of related issue and add action like send email.  

Troy
Contributor
July 19, 2023

Hi @Vikrant Yadav thanks for the pointer. I was trying that but will need your help to complete :)

I have created a manual trigger as you can see in the screenshot below and for Send email content I used the below smartvalue as I picked from https://community.atlassian.com/t5/Automation-questions/Jira-Automation-Send-email-notification-when-an-epic-is-complete/qaq-p/1541450

Here are the list of issues in the epic:
<ul>
{{#lookupIssues}}
<li><a href="{{url}}">{{key}}</a> {{summary}}</li>{{/}}
</ul>

 

When I trigger the rule, audit log says 'No actions performed' :(

I would like to display

Issue Key(with url) - Issue Summary - Issue Type - Status - Assignee

Please help me to construct the email content.

image.png

Vikrant Yadav
Community Champion
July 19, 2023

Hi @Troy Here is the working Automation Rule Screenshot and Video URL  :- 

https://we.tl/t-ik3LwqKCqN

 

Screenshot 2023-07-20 120525.jpg

Like Troy likes this
Like Troy likes this
Troy
Contributor
July 20, 2023

Thanks a lot @Vikrant Yadav really appreciate your quick support with this 👍

Like Vikrant Yadav likes this
Vikrant Yadav
Community Champion
July 20, 2023

@Troy  Glad to hear, I am able to help you out!

Kindly accept the solution, if it works for you. It help others having same query. 

Like Troy likes this
3 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
July 17, 2023

Hi @Troy

Unfortunately, this is trickier than one might think; as a "hierarchical query", it would really require some kind of "join" or "subquery", which isn't available in plain Jira/JQL.

A few directions forward:

  • If it's a one-off thing, you could first query the relevant epics, and then use the keys of these epics in a second query, in an ""Epic link" in (KEY-1, KEY-2, ...)" clause.

If you want to run your search "dynamically", without manually "stitching" two queries together, you'll need extra tooling:

  • You might be able to use Jira Automation to "propagate" epic information down to the epic's children, and then use the respective field(s) on the children to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. Scriptrunner has been mentioned before; I've used JQL Search Extensions a few times and it works well.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case would be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

Troy
Contributor
July 17, 2023

@Hannes Obweger - JXL for Jira super useful, thank you for the detailed explanation Hannes.

Hannes Obweger - JXL for Jira
Atlassian Partner
July 17, 2023

Just to expand on the last point, this is how this would look in the app that my team and I are working on, JXL for Jira. Put simply, you'd create a sheet with all issues that are potentially relevant to you, enable the default issue hierarchy (that's just one click), and then use JXL filtering capabilities to narrow down to the issues that you care about:

epics-by-label.gif

(I'm using labels here, but it would work the same way with any other field.)

Once you have your list of issues, you can work on these directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!

2 votes
Charlotte Santos -Appfire-
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.
July 17, 2023

Hi @Troy 

I’m Charlotte, a support engineer at Appfire and I’m here to help you.

Unfortunately, using JQL of Jira, you’ll not be able to do it dynamically.

In the app where my team works, JQL Search Extensions for Jira, you can use this query to find all stories whose parent Epic got the fixVersion V1, for example:

issue in childrenOfEpicsInQuery("fixVersion='V1'") AND type = Story

Please contact our support if you have any other questions about this query.

We’ll be happy to help you!

Best regards,

Charlotte

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events