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:
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.
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.
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.
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.
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 ;)
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events