Issue Link Functions
The following functions use issue link attributes to sort through issues.
This query returns all issues with the specified link (such as blocks or relates to).
linkedIssuesOf(Subquery, [link name])
This is similar to
subtasksOf, in that it returns the linked issues.
To find all unresolved issues that are blocked by issues in the Open state you could use:
issueFunction in linkedIssuesOf("status = Open", "blocks") AND resolution IS EMPTY
With no link name argument, this function searches for the linked issues whatever the link type:
issueFunction in linkedIssuesOf("resolution = unresolved")
This is similar to
linkedIssuesOf, in that it returns the linked issues, however this function searches issue links recursively to return all issues that are linked (directly and indirectly) to the results of the initial subquery.
linkedIssuesOfRecursive(Subquery, [Link name])
To find all direct and indirectly linked issues of an particular issue you can use:
issueFunction in linkedIssuesOfRecursive("issue = DEMO-1")
So if we have the following setup:
The query would return: DEMO-1, DEMO-2, DEMO-3, DEMO-4 and DEMO-5.
DEMO-1 is returned by the query above as it has is blocked by links from DEMO-2 and DEMO-3.
Limit the type (and direction) of links that are searched using a second parameter.
issueFunction in linkedIssuesOfRecursive("issue = DEMO-1", "blocks")
In this instance, if we use the example already mentioned, only DEMO-2, DEMO-3 and DEMO-4 are be returned.
The Link Type parameter behaves exactly the same as the Link Description parameter for linkedIssuesOf.
If you have thousands of indirectly linked issues, searching all of the links will cause a delay in execution time.
This function is exactly the same as
linkedIssuesOfRecursive but allows limitations to the depth of search along issue links.
linkedIssuesOfRecursiveLimited(Subquery, Traversal depth, [Link name])
The following query follows all links, recursively, from all issues in the DEMO project until it has searched a maximum of 2 links deep along any link path.
issueFunction in linkedIssuesOfRecursiveLimited("project = DEMO", 2)
Using the following setup:
Our query with the depth parameter returns: DEMO-1, DEMO-2, TEST-1, TEST-2, TEST-4 and TEST-5.
We could specify the link name as well, to get different results:
issueFunction in linkedIssuesOfRecursiveLimited("issue = TEST-2", 3, "is blocked by")
which would return: TEST-3, TEST-6 and TEST-5.