JQL for issueLinkType="blocks"

Brad_B November 20, 2019

Hey,

For a test, I have two issues: Issue One and Issue Two.  Issue Two "is blocked by" Issue One, by creating a link between those two records.

If I do the JQL statement: issueLinkType = "is blocked by", Issue Two is correctly the only issue that is returned.  Here is a screenshot of that query:

IssueTwo.PNG

However, when I execute the JQL Query: issueLinkType = "blocks", (lower-case b, to distinguish it from "Blocks"), instead of only returning issues that block other issues, it returns all issues that are either blocking, or being blocked--in the example, both Issue One and Issue Two are returned.  Here is a screenshot of that query:

IssueOne.PNG

(1) How can I create a JQL query that will only return issues that block another issue, or (2) is this just a bug in how the "blocks" keyword behaves, at the moment?

Here is a quick video demonstration of the issue, in case anything about this question is unclear:  Link to quick YouTube video demonstrating question 

I've tried issueLinkType != "is blocked by", but that doesn't return anything.

Thanks, let me know if anything could use clarified.

5 answers

1 accepted

14 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 21, 2019

Hi Brad,

Sorry to hear about this problem, but I know why this is happening now.   The issueLinkType JQL function is able to let users search on the inward description, outward description, AND the name of the link type that encompasses both.   In this case, the link type is named 'Blocks' and the outward description is also 'blocks'.  Since these two values are the same because JQL is not case sensitive, anytime you search

issueLinkType = blocks

the function is defaulting to the link name instead of the description. Hence in this case, you can't find only the issues with that outward description linktype here. 

The workaround for this is to change that description from 'blocks' to something that is unique such as 'blocking' or 'is blocking'.  As a Jira admin/site-admin you can do this by going to the issue linking feature in the system admin panel (keyboard shortcut of G+G and search for issue linking or go to /secure/admin/ViewLinkTypes!default.jspa)

This way you can search based on those descriptions.  I have also recently create a pair of feature requests that if implemented would avoid this problem in

 

I hope this helps, let me know if you have any questions about this.

Andy

Payne
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.
November 21, 2019

@Andy Heinzer, I suspected that as well, and it may well explain the behavior in Cloud, but I confirm that in our 8.5.0 server installation that issueLinkType = Blocks returns only the issues containing a blocks link (none with a is blocked by link). Our link type is configured as you describe: Name is Blocks; Outward Description is blocks; and Inward Description is is blocked by. I think this is a cloud-only issue.

Brad_B November 25, 2019

Andy, I decided to change the "Name" of the issue link to "Blockers," but that is the essence of what you said to do.  Awesome, thank you so much.  You crushed my question.  Thanks.

Brad_B November 25, 2019

@Andy Heinzer Now we just need the filters on the next-gen agile boards, and that will be awesome.  I will be able to completely view the "doable" items, based on filtering for unblocked items.  Thank you, again.

Like Salim GOMRI likes this
Kevin Suter February 12, 2020

@Andy HeinzerThanks for your answer. I had the same question.

Wolfgang Seidler November 11, 2020

Sorry to pick up the topic again for current cloud:

One of my clients also has "Roadmap Link" as link name, "implemented in" as outward description and "implemented for" as inward description.

JQL IssueLinkType != "implemented in" still lists the issues that ONLY HAVE "implemented in" as issue link. Same for "implemented for". Only the JQL IssueLinkType != "Roadmap Link" excludes the relevant issues.

So my conclusion currently is, that the JQL expression only delivers proper results, if you use the Issue Link NAME. Which disables to search for issues in certain direction (inward/outward).

Probably I should raise this as bug, but I cannot find the documentation for this JQL expression right now.

BrianW July 22, 2021

@Andy Heinzeret al, this documented solution would be great, but Jira Cloud now recreates the default 'Blocks' issue link type if you rename that default link type to something else to make JQL work correctly.  I reported this and it is documented in https://jira.atlassian.com/browse/JSWCLOUD-20736 but it was closed as Not a Bug. 

If you rename 'Blocks' to something like 'block' or 'BlockType', Jira will recreate 'Blocks' with the directional 'blocks' and 'is blocked by', and users end up having to choose between two identically named but different link types when linking issues!

I have not been able to find any workaround for this.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2021

Hi @BrianW 

Thanks for flagging this.  I have linked that other issue to my previous feature request because they are certainly related now.  Sorry to hear about this problem. 

However my previous recommendation was not to rename the linktype Name field here, but instead to rename the Outward Description instead.  Granted for the Blocks linktype the string of 'blocks' exists in both the Name and Outward description by default.  My recommendation here is to change the Outward description to a value such as 'blocking' or 'is blocking'.  This in turn does not appear to get renamed or recreated automatically by Jira Cloud, and can still provide you with distinctive terms to search upon within JQL.

Try that instead and let me know if you run into problems with that approach.

Andy

BrianW July 22, 2021

Thanks @Andy Heinzer, I have tried that and will see if it tricks Jira into not creating another competing Blocks link type.

9 votes
AnkitSurana
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!
February 25, 2022

I achieved it without changing the description. To achieve the required list of issues that block other issues we have to subtract one filter from another as below.

To get those issues that are blocked by other issues

1 ) Filter1 -->  issueLinkType = "is blocked by"

To get those issues that are blocking other issues.

2) Filter2 -->  issueLinkType = "blocks" and filter!=Filter1

Alimukhamed Tlekbai
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!
November 8, 2022

This is probably the only working answer here.

Don't forget to save filters when implenting this. It took me 30mins to figure out that one of my filters wasn't saved.

mike.park
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 14, 2023

@AnkitSurana What happens if an issue both "blocks" other issues and "is blocked by". I guess this won't show up in Filter2 despite the fact it blocking.

0 votes
Ian Rees August 14, 2023

Hi @Brad_B , I love this suggestion of changing the outward description to something different.  I am hesitating because I am not sure what how or whether any exiting users, practices would be affected by this.  Is there anything I should look out for ?

0 votes
Stefan Hänni
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!
December 11, 2020

Same happen for me today. also used the workaround but I rename the "Name" to Blockers and not the description. 

0 votes
Payne
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.
November 20, 2019

FYI, it seems to work as expected in Jira server (I see that you're using cloud). 

Brad_B November 25, 2019

Thanks for the response, it looks like it had to do with the name of the issue link and the outward description matching, combined with the fact that JQL is not case sensitive.  Thank you for the response.

Suggest an answer

Log in or Sign up to answer