It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Filter Issues that are Open+Blocking OR Blocked by Open Issues Edited


We have ScriptRunner available, if it helps.  We're trying to find issues that are:

  1. Open AND Blocking Open Issues (don't show issue if only blocking Done issues)
  2. Open AND Blocked by Open Issues (don't show issue if blocking issues are Done)


In other words, my current search returns an issue that is "blocked" but the blocking item is done.  In this case, I don't consider the issue to be blocked anymore because the blocker is Done.


Current Filter

issueFunction in hasLinks("is blocked by") or issueFunction in hasLinks("blocks") 


3 answers

So, I think you're about half way there.  The hasLinks JQL function provided by scriptrunner can help you find those issues.  But you then also need to lookup the status of those linked issues to be able to make sure you don't include blocked issues that are already in a status of "Done".   Fortunately, it looks like scriptrunner does have another function called linkedIssueOf that can help here.

(issueFunction in hasLinks("is blocked by") AND issueFunction in linkedIssuesOf("status != Done", "blocks")) OR (issueFunction in hasLinks("blocks") AND issueFunction in linkedIssuesOf("status != Done", "is blocked by"))

I think that this JQL query, with scriptrunner of course, can help with locating the issues you are wanting to see here.

Jira 8:  "is blocked by" -> "depends on"

0 votes

Is there a way to do this without Scriptrunner in Jira 8+?

There is the new feature of "issueLinkType", but this would not check the status of the linked issues.

0 votes
Andy Heinzer Atlassian Team Jul 18, 2019

Hi @[deleted] 

Not exactly.   It is true that with Jira 8.0.0, there is a new JQL search feature that will let you search for Jira issues that have a specific link type.  More details in  Advanced Searching: Field reference: Issue link type.

However this does not extend itself to let you search both the issues that have links and the linked issues status in a single query.

You would have to formulate the query to return specific issues, instead trying to use native Jira JQL to lookup related issue values.  This is something that plugins like scriptrunner can do because they are utilizing other code to return such results.

You could create a query such as

status=open and issuelinktype in (blocks)

Just to see issues in that state with at least one linktype of blocks.   But since we can't lookup the linked issue status, you could try something like

issuelinktype in ('is blocked by') and status=open

This would return the issues that have the reciprocal link type and their status, but again it won't show you the status of the issues on the other side of that link.  

I hope this helps.


That's great to hear Andy! We've been wanting something like this for a while. I gave JQL Pro (formerly Plus?) a go and ran into limitations in the query syntax. It supports a subset of Mongo query language. I've since uninstalled that app due to that limitation.

Even with that, and with the new issue link operators in advanced search, I wasn't able to build filters that answer questions like: Which issues in this project...

  1. ... were previously blocked by issues that are now done?
  2. ... are blocking issues in another project?
  3. ... are blocked by issues that are still not done?

I was able to express this logic in JQL Pro/Plus with MQL, but the app's implementation was buggy and it didn't seem worthwhile to pursue fixes there.

To save time during backlog refinement we have widgets in Confluence that display filters like these. Widgets for #1 and #3 could be addressed by a simple "is blocked by" filter, but in reality they deserve very different levels of attention, hence the further conditional of whether the blocking issue is done.

To address these limitations I wrote a Python script which we're refining and plan to install somewhere that it can run at interval to update these filters when it stabilizes.

We're using JIRA to manage a Scrum backlog which I imagine is fairly common, and so maybe this script will be useful to someone else. Even if not, I hope the otherwise unanswerable questions above will generate some feedback. Maybe I've overlooked something in advanced search?

For our backlog, we're using a label to "bless" issues that are sufficiently well-defined to be accepted for development, and so we don't need to see those issues when we're refining the backlog, just the issues that need attention. It's easy enough to exclude issues based on a label in JQL, and the Python script uses that with an option like `--exclude-labels blessed`.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

269 views 1 2
Join discussion

Community Events

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

Events near you