Forums

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

How to use sub-query in Jira Cloud

Chueng Wee Chou April 1, 2025

I was on OnPrem Jira when I used the command linkedIssuesOf(). I have migrated to Jira Cloud and this function does not work anymore.

My old query

project = ABC AND Resolution in (Fixed, Done) issueFunction in linkedIssuesOf("filter = 'All Bugs'") where All-Bugs is a filter for issue type bug.

Anyone can suggest an equivalent jql command in Jira cloud to enable linkedIssuesOf() ?

1 answer

1 accepted

2 votes
Answer accepted
Pasam Venkateshwarrao
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.
April 1, 2025

Hi @Chueng Wee Chou 

Welcome to the community you can use this JQL

project = "XYZ" AND Resolution in (Fixed, Done) AND issueFunction in linkedIssuesOf("type = Bug")

Hope this helps.

Chueng Wee Chou April 2, 2025

Hi Pasam, the  problem I am facing in Jira Cloud is that "issueFunction" is not supported. 

I don't know if this is a permission issue or this function is not in Jira cloud

Pasam Venkateshwarrao
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.
April 2, 2025

@Chueng Wee Chou Jira Cloud does NOT support issueFunction (ScriptRunner is missing)

you can try this with JQL

project = ABC AND resolution IN (Fixed, Done) AND issueLinkType IS NOT EMPTY AND type = Bug

Chueng Wee Chou April 2, 2025

Thanks - this works partially

project = ABC AND resolution IN (Fixed, Done) AND issueLinkType IS NOT EMPTY AND type = Bug

The query output all the issues with issueLinkType that is not empty. What I need is the issueLinkType that is not empty is of type "Bug". 

Example

1. Issue A is of type Support Request. It has a linked "relate to" of type = Bug.

2. Issue B is of type Support Request. It has a linked "relate to" of type = Technical Improvement

 

The query should only return number 1 and not return number 2. Currently the query returns both

 

Pasam Venkateshwarrao
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.
April 2, 2025

@Chueng Wee Chou i have tried with this it works well

1. Issue A is of type Support Request. It has a linked "relate to" of type = Bug.

type = " Support Request" AND issue IN linkedIssues(ABC-123, "relates to")

ABC is Bug Issuetype and  Support Request that are related to a specific Bug.

 

2. Issue B is of type Support Request. It has a linked "relate to" of type = Technical Improvement

type = "Support Request" AND issue IN linkedIssues(XYZ-456, "relates to")

XYZ is Technical Improvement issue 

 

Pasam Venkateshwarrao
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.
April 2, 2025

@Chueng Wee Chou is this works for you

Chueng Wee Chou April 2, 2025

Hi Pasam, it works for single record and I need to hard code the key value.

I need to generate a list of records - how do I replace the "ABC-123" which a parameter of the key?

Chueng Wee Chou April 2, 2025

My query is like this

project = ABC AND resolution IN (Fixed, Done) AND status in (Closed, Resolved, Done) AND issueLinkType IS NOT EMPTY AND type IN ("Support Request") AND Issue IN linkedIssues(ABC-123, "relates to")

What value should I use in place of "ABC-123" so that the query will know, the key value linking the Parent issue (type - Support Request) to the linked issue (relate to) with type - Bug

 

Pasam Venkateshwarrao
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.
April 2, 2025

@Chueng Wee Chou In Place of ABC-123 you can use project key(ABC) and issue no(123)

Chueng Wee Chou April 2, 2025

still do not get it. Perhaps you can help me to type out the whole JQL

Pasam Venkateshwarrao
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.
April 2, 2025

@Chueng Wee Chou 

From your JQL ,you should use linkedIssues() Instead of issueLinkType IS NOT EMPTY(In Jira cloud will not support) If you must filter only issues with links, you’d need a Jira plugin like ScriptRunner

I Have replaced your JQL 

project = Test Project AND resolution IN (Fixed, Done) AND status IN (Closed,Resolved, Done) AND type = "Support Request"
AND issuekey IN linkedIssues(TP-123, "relates to")

Removed issueLinkType IS NOT EMPTY (because JQL doesn’t support it).
Replaced Issue IN linkedIssues(...) with issuekey IN linkedIssues(...) (correct format).
Used type = "Support Request" instead of IN ("Support Request") (simpler when using one value).

 

Hope this helps

Chueng Wee Chou April 4, 2025

I got ScriptRunner installed into JIRA Cloud and my JQL statement works.

Thanks Pasam for all the guidance. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events