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!

sparrowt
  • 2,641
  • 25
  • 24
James An
  • 1,383
  • 1
  • 10
  • 16
  • 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](http://confluence.atlassian.com/display/JIRA042/Advanced+Searching?clicked=jirahelp#AdvancedSearching-linkedIssues) – Alexander Oct 26 '11 at 10:29

4 Answers4

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")
nico gawenda
  • 3,648
  • 3
  • 25
  • 38
9

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

north5
  • 393
  • 1
  • 8
Vladimir Alexiev
  • 2,477
  • 1
  • 20
  • 31
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])
Vitalii Zurian
  • 17,858
  • 4
  • 64
  • 81
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

Mark McDonald
  • 7,571
  • 6
  • 46
  • 53