Forums

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

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

ajirebardyn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 8, 2021

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
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.
March 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.

Sandhya.Godavarthy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2022

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
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 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
Linda Milne_Togetha Group_
Atlassian Partner
March 8, 2021

 

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 Warner
Atlassian Partner
March 8, 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
TAGS
AUG Leaders

Atlassian Community Events