Forums

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

Fetching stories and its related bugs through JQL

shiwani sinha
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!
January 10, 2024

Hi 

I need to fetch stories and dependent bugs through JQL how can I do that 

I used the following jql please suggest what I should add to get User story in the result , With this query I am getting only bugs ,not all dependent on user stories. and I want both.

 

project = "MyProject name" AND status in (Development, QA, Closed) AND issuetype = Bug AND issueLinkType = "is a dependent of"  ORDER BY created DESC

3 answers

2 votes
Laurie Sciutti
Community Champion
January 10, 2024

Hello @shiwani sinha and welcome to the Community!  Unfortunately, the base Jira product does not provide this functionality natively.  If you use Scriptrunner, you can use the issueFunction in linkedIssuesOf(subquery) JQL function.

project = "MyProject name" AND status in (Development, QA, Closed) AND issuetype in (Story, Bug) and issueFunction in linkedIssuesOf("issuetype = Bug, Story)", "is a dependent of")

 

I believe JQL Search Extensions for Jira also provides similar functionality.  Do you use either of these addons?

0 votes
Charlotte Santos -Appfire-
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.
January 10, 2024

Hi @shiwani sinha 

I’m Charlotte, a support engineer at Appfire and I’m here to help you.

Unfortunately, using vanilla JQL, 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 bugs that are linked to stories and the stories linked to the bugs:

issue in linkedIssuesOfQuery("project='My Project Name' AND status in (Development, QA, Closed) AND type = bug", "is a dependent of") AND type = Story OR issue in linkedIssuesOfQuery("project='My Project Name' AND status in (Development, QA, Closed) AND type = Story”, "is a dependent of") AND type = Bug

Please contact our support if you have any other questions about this query.

We’ll be happy to help you!

0 votes
Joseph Chung Yin
Community Champion
January 10, 2024

@shiwani sinha -

Welcome to the community.  I agreed with what @Laurie Sciutti suggested.  JQL out of the box it is not possible.  You will need third party add-ons to give you those additional functionality (i.e. additional JQL functions).

The one that we used extensively is ScriptRunner for Jira - https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?hosting=cloud&tab=overview

It not only give you their custom JQL functions + also the add-on provide you a process where you can create your own JQL functions.

Hope this also helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events