48

Is there a way to query for all issues with a particular link type?

For example, let there be a dependency link where an issue can "depends on" another issue. Is there a query to find all issues that depend on some other issue (aka. all issues with the "depends on" link)?

I know there is the linkedIssues (key, linkType) function that returns the key of all issues that have the linkType with the issue with key. I want to find all issues with a linkType with any issue.

Thanks!

1
  • It's possible with Jira4 (tested on 4.2.4) issue in linkedIssues(ABC-123) issue in linkedIssues(ABC-123,"depends on") See Manual page
    – Alexander
    Oct 26, 2011 at 10:29

4 Answers 4

18

You can use Script Runner plugin - Edit: It unfortunately is no longer free. The last version before 4.0 still is, though. Details here https://www.adaptavist.com/doco/display/SFJ/Downgrade+ScriptRunner

It sports a ton of incredibly useful functions, one of these is hasLinks()

Usage example:

issueFunction in hasLinks("blocks") OR issueFunction in hasLinks("is blocked by")
1
  • 2
    This is the correct answer. Script Runner is very robust and free.
    – Shanerk
    Dec 3, 2014 at 15:38
9

You can hack it with Craftware JQL's linkedIssuesFromFilter, where the filter would be "all issues"

2
  • 1
    The free Script Runner add-on will be a better option for most as it is freeware and heavily supported. See answer below from @nico-gawenda.
    – Shanerk
    Dec 3, 2014 at 15:40
  • 1
    unfortunately Script Runner is no longer free :( Mar 24, 2017 at 13:20
2

The included function mentioned by Alexander is ideal for its purpose but if you want something more advanced check out the commercial JQL Tricks plugin: https://studio.plugins.atlassian.com/wiki/display/JQLT/Issue+Link+Functions

2

If you need a JIRA On-Demand solution - you might find this paid Add-On useful

It exposes MongoDB syntax and some conditions builder UI, so you should be able to search for the issues:

  • linkedIssuesHaveStatus([status])
  • subtasksHaveStatus([status])
  • linkType([linkType])
  • workBetween([started|created|updated], [from], [to])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.