JIRA: Searching for all issues with a given link type
Asked Answered
T

5

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!

Tribulation answered 12/10, 2010 at 19:24 Comment(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 pageHydrokinetic
C
9

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

Croupier answered 5/12, 2011 at 23:26 Comment(2)
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.Joannejoannes
unfortunately Script Runner is no longer free :(Lashay
I
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")
Isidore answered 8/8, 2014 at 14:18 Comment(1)
This is the correct answer. Script Runner is very robust and free.Joannejoannes
C
9

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

Croupier answered 5/12, 2011 at 23:26 Comment(2)
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.Joannejoannes
unfortunately Script Runner is no longer free :(Lashay
I
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

Integral answered 26/10, 2011 at 23:50 Comment(0)
K
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])
Kira answered 11/9, 2014 at 13:39 Comment(0)
M
0

In 2024, you can simply use issueLinkType. Works on Jira Cloud. No need for add-ons or plugins.

For example issueLinkType=Duplicate will give you all issues with that type of link. Or you can be more specific and use issueLinkType="is duplicated by" to indicate direction.

Can match the link Name, or the inward/outward descriptions, as found on the IssueLinking configuration page: /secure/admin/ViewLinkTypes!default.jspa

Modica answered 17/5 at 8:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.