JQL for Blocking Issues

Ammaar Ahmed April 30, 2020

Hi,

 

I am trying to write a JQL query to filter blocking issues for a specific project.  So far I have:

 

project = "Project Name" AND issuelinktype = blocks

 

However, the results show both blocking issues and issues that are "blocked by".  I would like the filter to only show the blocking issues and exclude the "blocked by" issues.  Any advice?

 

Thanks,

 

Ammaar

3 answers

1 accepted

3 votes
Answer accepted
Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 30, 2020

Hey @Ammaar Ahmed

please have a look at your issue link configuration. By default, the issue link type "blocks" has the name/description "blocks" and the outward description "blocks". I'm pretty confident that the JQL function looks at the description value as well. So try a different name for it. I tried this once but also had to recreate some issue links. Indexing seemed a bit off but after that I really only got the right results returned.

Please let us know if that solved your problem. :)

Best, Max

Ammaar Ahmed April 30, 2020

Hi @Max Foerster - K15t

 

I am not sure I understand the recommended solution.  Here is an example:

 

Annotation 2020-04-30 115426.png

 

So, I would want BI-36 to show up in the filter, but do not want to see BI-24, BI-23, and BI-27.  Does this make sense?

 

Thanks,

 

Ammaar

Like # people like this
Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 30, 2020

Hey Ammaar,

makes sense to me and I just tried to explain to you why you get the wrong results returned with your JQL filter. Do you notice the "Name" and "Outward Description"? That's causing the behaviour and feel free to change the configuration to fix it for you. :) issue_linking.png

Best, Max

Like Daria Pavlova likes this
Ammaar Ahmed April 30, 2020

Thanks @Max Foerster - K15t ,

The fix worked!  Now I have set up some JQL queries on the board to indicate colors for the issues that are blocking (red) and the issues that are blocked by (blue), for better visual management.  I am almost there, the only thing I am trying to figure out is I want the color for a "blocked by" issue to go away when the corresponding blocking issue is resolved.  Any suggestions on JQL for this?  Right now I have:

 

project = "Business Intelligence " AND statusCategory != Done AND issuelinktype = "is blocked by"

 

I am on Jira Cloud.

 

Thanks,

 

Ammaar 

Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 1, 2020

That's not possible by default in Jira. You will need a third-party app to add this kind of JQL functions.

Best, Max

Like daishi-kikuchi likes this
Ben Sharir January 10, 2022

I renamed the Outward Description from 'blocks' to 'blocking' and tried the jql query and the results are still the same. Do I need to give some time for the indexing in the background to complete?

project = {project id} AND Sprint in openSprints() AND issueLinkType = blocks

Max Foerster - K15t
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 11, 2022

So the description name is still "blocks", @Ben Sharir

Ben Sharir January 11, 2022

The outward description is now 'blocking'. I wonder if it's because block and blocking both has the same root and Jira's search is trimming words and searching the root word. I can try a completely different word and see if it makes a difference.

Ben Sharir January 11, 2022

I renamed the outward description from 'blocks' to 'preventing' and now it's working as expected. Thanks @Max Foerster - K15t !

Like # people like this
0 votes
Ignas Selvestravičius January 24, 2023

Sooo maybe someone is still looking for the solution. Short answer: change the name of the link from "Blocks" to something else like I did "Issue blocks" and then the JQL

 issueLinkType = "blocks" 

returns issues only with outward link type "blocks"image.png

The solution is provided in Atlassian documentation here.

0 votes
lenI June 17, 2021

What we use to identify blocker links is the following: 

issueFunction in linkedIssuesOf("key in (JIRAKEY-XXXX) and status not in (closed, done)") and project = "PROJECT ID" and issuetype in (bug,incident) AND status not in (closed,Done) AND issueFunction in hasLinks("blocks")

Ben Sharir January 10, 2022

@lenII tried your suggestion and received this error message:

Your JQL includes the [hasLinks] function from the [Adaptavist Scriptrunner] app for Jira Server. This function works differently in Jira Cloud. Refer to https://docs.adaptavist.com/sr4jc/latest/features/scriptrunner-jql-keywords-functions for details.

Emanuel Y February 9, 2023

Hi @Ben Sharir is there another way to see your link? If it is a pic can you post it here? The link is currently taking us to the the wonderful 404 club. :-) 

Ben Sharir February 9, 2023

@Emanuel Y It's a message I received from Jira. Try it yourself and see if Jira updated the link or message. 

Suggest an answer

Log in or Sign up to answer