Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,058
Community Members
 
Community Events
176
Community Groups

How to get stories only with resolved defects + bugs which are ready to deploy using JQL?

Is there any possibility to find all stories with defects that are, resolved and ready to deploy bugs using JQL in Jira? For example, I got Story ABC with two bugs (B1, B2) linked as Defects. One of these bugs (let's say B1) it's done and ready to deploy, but another one (B2) is still in status To Do. I prepared this JQL, but it doesn't work as I expected :/

project = "ABC" AND (issue in requirementsWithDefects("", "Resolved")) AND fixVersion = xxx and issuetype = "Story" AND  status in ("To Deploy") OR issuetype in (Bug) and project = "ABC" and fixVersion = xxx  AND status in ("To Deploy")

It still lists bug B1, which is associated with a particular story ABC. I don't want to filter these types of bugs. These two bugs should be listed only when the parent story is ready to deploy. Is there a way to do that?

3 answers

1 vote
Daniel Ebers Community Leader Mar 10, 2021

The function "requirementsWithDefects" seem to originate from a testing App - but according to your saying it could work like this, assuming I understood you correctly.

type = story AND status = Resolved AND issueFunction in linkedIssuesOf("type=bug AND resolution is NOT EMPTY")

Will get you stories which are in status resolved and have at least one linked issue of type "Bug" which is resolved - of course, you would need adjust this to match your namings (Issue Types and such).

Does this come close to what you are after?
Although we do not know your hosting type, a disclaimer: this applies to Server and the usage of Script Runner.

Hi Daniel , 

When I try this query I am getting an error as mentioned below. can u pls help here. 

 

Query - project = CA AND type = story AND issueFunction in linkedIssuesOf("type=bug AND resolution is NOT EMPTY") order by created DESC

error - Your JQL includes the [linkedIssuesOf] function from the [Adaptavist Scriptrunner] app for Jira Server. This function works differently in Jira Cloud. Refer to https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-jql-keywords-functions for details or contact the app provider

Filters that I am trying to create are - Filter1 - Find the user stories with open bugs , filter 2 - Find the user stories with resolved bugs

Daniel Ebers Community Leader Jul 31, 2022

The message suggests you need to use "Enhanced Search" in that case - this is special to Jira Cloud:

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

Going there is should be perfectly possible to write the JQL queries you are interested in.

Like Taranjeet Singh likes this
0 votes

 

Unless something has changed, it looks like you need a plugin for this: https://community.atlassian.com/t5/Jira-questions/jira-query-issues-with-linked-issues/qaq-p/426769

0 votes
Kat Marketplace Partner Mar 08, 2021

At first glance you may want to add some brackets to group related clauses together. The order of operations with long queries with a mixture of AND and OR is not always intuitive.

You have the clause "project = "ABC"" twice but is not easy to see the purpose of this without spending time breaking down the query.

Suggest an answer

Log in or Sign up to answer