It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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)

with Scriptrunners 

 issueFunction in linkedIssuesOf(Subquery, [link name])

would work for you

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

Thanks a lot for your reply @fran garcia gomera !

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. 

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.

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you