Forums

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

Combining Jira Queries: Search for issues based on previous query results

Nataliya Romaniv October 8, 2019

Hello,

I need to create a query that would return all the defects linked to the stories processed in a particular sprint.

To find the stories I can use the following query 1.:

project = X AND sprint =Y AND type = story AND status not in (Z)

To find the defects linked to a story, I can apply:

project = "X" AND type = bug and issue in linkedIssues(issueKey)

The question is: how can I combine these two queries, so that I don't need to run the query 1 one and then manually put the story IDs into the query 2.

I would be very grateful for your suggestions.

4 answers

1 vote
Muhammad Ramzan(Atlassian Certified Master)
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.
October 9, 2019

you can use  JQL Search Extensions for Jira & reports plugin

 

In your case following query will get the required results.

issue in linkedBy("project = X AND sprint =Y AND type = story AND status not in (Z)")

 

https://jqlsearchextensions.atlassian.net/wiki/spaces/SEARCH/pages/30497099/JQL+Reference+Server#JQLReference(Server)-LinkedBy([linktype],jql-queryorissuekeys)

0 votes
Nataliya Romaniv October 10, 2019

Thank you all for such quick replies!

As far as I understand, this is possible via add-ons only, which are currently not purchased by the company.

0 votes
Matthias Gaiser _K15t_
Community Champion
October 8, 2019

Hi @Nataliya Romaniv

I believe there is no standard JQL way to fulfill your needs.

If you have scriptrunner installed, you should be able to use the linkedIssuesOf function like this:

project = "X" AND type = bug AND issueFunction in linkedIssuesOf("project = X AND sprint =Y AND type = story AND status not in (Z)")

See also more details in their documentation or in a similar question.

Cheers,
Matthias. 

Nataliya Romaniv October 8, 2019

Hi @Matthias Gaiser _K15t_ ,

Thanks a lot for your reply.

I'm afraid I do not have the Scriptrunner, nor the access to Jira Administration to install it.

0 votes
fran garcia gomera
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.
October 8, 2019

with Scriptrunners 

 issueFunction in linkedIssuesOf(Subquery, [link name])

would work for you

https://scriptrunner.adaptavist.com/latest/jira/jql-functions.html#_linkedissuesof

Nataliya Romaniv October 8, 2019

Thanks a lot for your reply @fran garcia gomera !

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events