How can I write a JQL query to return both Stories and Tasks based on the value of an attribute that

laurie huffmire April 11, 2023

How can I write a JQL query to return both Stories and Tasks based on the value of an attribute that is in the Story only? 

Stories have attribute of PROD Release Date, but Tasks do not have this attribute. 

I would like to run a query that will list all STORIES with a specific PROD Release Date and have the results return all Stories and their tasks. 

 

4 answers

1 vote
Ditte Simard
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2023

There might be a cleaner way to write this, but if you have Adaptavist ScriptRunner installed, you can do something like this:
ProdDate = blah OR issueFunction in subtasksOf("ProdDate = blah")
That will return Stories that match the PROD Release Date field and the subtasks of those Stories.
This is assuming that ProdDate only exists for Jira Stories, otherwise you will have to add that as a condition in the beginning as well.  
Hope this helps!

laurie huffmire April 12, 2023

Hi, Thank you, I am confirming if Adaptavist ScriptRunner is installed. 

Like Ditte Simard likes this
1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 11, 2023

Hello @laurie huffmire 

Welcome to the Atlassian community.

How are the Tasks related to the Stories? Are they linked issues?

Jira does not natively provide JQL functionality to get linked issues for more than one issue at a time. There is the linkedIssues function, but you have to give it a single issue key as an input. You can't give it a list of issues, or a subfilter that selects a list of issues.

You will likely need a third party app that extends searching functionality, like Adaptavist ScriptRunner or JQL Tricks. Do you already have such an app or are you open to getting one?

laurie huffmire April 12, 2023

The tasks are linked to the story. 

laurie huffmire April 12, 2023

I am inquiring if Adaptavist ScriptRunner is available. Thank you. 

0 votes
mauricio.groth
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.
April 12, 2023

Hi @laurie huffmire 

I’m Maurício, 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 the Stories with a specific PROD Release Date and all the Tasks linked to them:

issue in linkedIssuesOfQuery("'PROD Release Date' = 'x' and type = Story") OR issue in linkedIssuesOfQuery("") and 'PROD Release Date' = 'x' 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,
Maurício

0 votes
Hannes Obweger - JXL for Jira
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 11, 2023

Hi @laurie huffmire

welcome to the community!

Just to add to the previous answers, another option might be to consider 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 can only speak for the app that my team and I are working on - JXL for Jira - but in JXL, your use case should be easy to solve:

subtasks-by-parent-label.gif

For context, JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of advanced features, including the support for issue hierarchies. Once enabled - for the default issue hierarchy, that's just one click - you can search through the various levels, as shown above.

Once you've narrowed down your list of issues, you can work on your issues directly in JXL, trigger various operations in Jira, or export your issues with just one click.

Any questions just let me know,

Hannes

Suggest an answer

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

Atlassian Community Events