JQL for all linked issues not done

Norton Lam July 30, 2020

HI,

 

I want to have a query that indicates when all the linked 'is blocked by' issues are not Done.  I want to use this in the Card Colors settings on a board so that I know if an issue is blocked by something else.  When all the 'is blocked by' issues are Done, I should not see that color anymore.

 

I have been trying to use ScriptRunner to accomplish this, but in the ScriptRunner Enhanced search, when I use a query like:

 

issuekey = <issue key> and issueFunction in linkedIssuesOf("status != Done", "is blocked by") AND resolution IS EMPTY

 

I get the following error:

 

Search parsing timed out. You probably have a subquery that returns too many issues.

 

I don't understand why that would happen for a specific issue where it only had 2 'is blocked by' issues linked to it.

 

Also, if I do get this to work, can I put the resulting query in the JQL field of the Card Colors?  Would it pick up ScriptRunner syntax?

 

Thanks in advance for your help.

2 answers

2 votes
Italo Qualisoni [e-Core]
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 30, 2020

Hi @Norton Lam ,

Based on your description, I think your JQL should be this:

issueFunction in linkedIssuesOf("issuekey = <issue key>", "is blocked by") and status != Done AND resolution IS EMPTY

First you need all issues blocked by your issue key and then filter for both status and resolution.

 

You need to save this query in your  ScriptRunner Enhanced, the name of the filter is important, so let's say you the filter name is "All Open isuses Blocked by Issue Key XYZ"

 

JQL won't accept the same Scriptrunner syntax but you should be able to use your Enhanced filter in your JQL using the below syntax:

filter = "All Open isuses Blocked by Issue Key XYZ"

 

I've never tested it in Card Color, but I think it might work.

Norton Lam July 30, 2020

Thank you, @Italo Qualisoni [e-Core] .  You partially answered my question.

 

Your query worked, but in the Card Color, it does the query based on the issue it is trying to show.  My query above would have eventually removed the clause before the first AND in order to show the correct result.  In your query, since the issuekey is being saved in the filter, it won't work.  Unless you know of a way that the system would do a field substitution.

 

Or, if I could pass the key in as a parameter, I could use the filter in a ScriptListener script.

Italo Qualisoni [e-Core]
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, 2020

Good to know that the JQL worked.

It's not possible to use field substitution in your JQL query.

You can pass the same query in your board, something like this:

issueFunction in linkedIssuesOf("project = XYZ and status != Done", "is blocked by") and status != Done AND resolution IS EMPTY

You will need to test and see what works for you. I think you can also reach Adaptavist support to ask for guidance to improve your JQL filter.

1 vote
Peter Retzlaff
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!
June 24, 2021

Hi @Norton Lam ,

I tried to achieve exactly the same thing today :)The query I used to find all issues that were still blocked by other issues is this:

sprint in openSprints() AND issueFunction IN linkedIssuesOf("sprint in openSprints() AND status != Done", "blocks") order by created DESC

As previously stated, you can then save that as a filter and use the "filter = <filter name>" query as your card color query.

This works well for me, although the automatic filter sync doesn't work for me right now, so it's not actually useful right now. However, that's a different problem ;)

Suggest an answer

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

Atlassian Community Events