hasLinks()

hasLinks()

Description:

Searches issues with / without issue links, additionally you can further refine your query by using a number expression.
See also: linkedIssuesOf() and hasRemoteLinks()

Note:

A 'number expression' is made of an optional operator representing by its mathematical symbol and a (prositive/negative) number.

By default, this function only includes issues with at least one remote link even if you use the '<' or '<=' operator.
   You must explicity add 'issues NOT IN hasRemoteLinks()' clause to your query, if you also want to search for issues without remote links.



Syntax

hasLinks()
hasLinks(numberExpression)
hasLinks(numberExpression, linkDescription)

Available since

v2.2.0-RELEASE

Supported fields

Issue

Supported operators

IN , NOT IN

Unsupported operators

= , != , ~ , !~ , > , >= , < , <=

IS , IS NOT , WAS , WAS IN , WAS NOT , WAS NOT IN , CHANGED

Examples:

• Find issues without issue links:

issue NOT IN hasLinks() issue NOT IN hasLinks("> 0")

• Find Stories that have three or more issue links

type = Story AND issue IN hasLinks(">= 3")

• Find Features that have been blocked by at least two issues

type = Feature AND issue IN hasLinks(">= 2", "is blocked by")

• Find issues within the EMEA project having less than 2 issue links or no issue links at all.

project = EMEA AND (issue IN hasLinks("< 2") OR issue NOT IN hasLinks())

Real World Use Cases:

· JRASERVER-25640 - JQL function for showing all issues linked to any issue by a given issue link type (by Chris Mountford)
· JQL query to see all Tests which are linked to all Stories in current Sprint (by SchuriiK at ATLASSIAN Community)
· JQL Query Assistance - Linked Issues (by jprentice at ATLASSIAN Community)

JQL Function Reference