Forums

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

Nested query in JQL for free (without ScriptRunner). Is it possible?

Taras Kobynets October 1, 2020

I need JQL to select issues that have status = "IN QA", and they have linked issues that have status = "OPEN"

3 answers

2 votes
Pierre-Yves December 30, 2022

That is interesting but does not fully answer to the question which mentions a "free" solution

2 votes
Mikael Sandberg
Community Champion
October 1, 2020

JQL out of the box does not allow nested queries.

The two functions mentioned are from apps, linkedIssuesOf() is available if you have Scriptrunner, and linkedIssuesFromQuery(subquery) is from another app that I do not know the name of. 

0 votes
Niranjan
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 1, 2020

@Taras Kobynets You can try these JQLs

status="IN QA" and issuefunction in linkedIssuesOf("status=open")

status= "IN QA" and issue in linkedIssuesFromQuery("status=Open")  - may have performance impact depending on the number of results

 

 

Taras Kobynets October 2, 2020

We have added ScriptRunner trial to our Jira cloud (see screen).
Bu I got this error when I try your query (screen2):
issue in linkedIssuesFromQuery("status=open")
Unable to find JQL function 'linkedIssuesFromQuery(status=open)'
SR2.jpgSR1.jpg

Here are more details:
Actually the goal is to highlight (using "card collor" feature of Jira) issues "IN QA" that have linked issues in "OPEN" state. The aim is to visually see on Kanban board if the issue is actually not complately ready for test, because it has linked issues that are still OPEN.

So we were thinking about something like this:
project = "Project1" AND status = "IN QA" and issueLinkType in ("relates to") and issue in linkedIssuesFromQuery(' project = "Project1" AND status = "OPEN" ')

Mikael Sandberg
Community Champion
October 2, 2020

Scriptrunner do not have a function called linkedIssuesFromQuery(subquery), that is why you get the error. You can use linkedIssuesOf(subquery) instead, which comes with Scriptrunner.

Like Taras Kobynets likes this
Taras Kobynets October 9, 2020

I feel like I am not sure if ScriptRunner actually activated, because I have this error:

"Field 'issueFunction' does not exist or you do not have permission to view it."

Do you know how I can check of ScriptRunner is active, to be sure?

SR3.jpg

Mikael Sandberg
Community Champion
October 9, 2020

Go to Settings > Apps > Manage apps and make sure Scriptrunner is listed there and that it is enabled.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events