Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Find linked issues recursively without epic links

Pavel Boev
Contributor
February 7, 2017

I have a story ABC-123, which is linked to other stories and bugs and they are also linked to other stories and bugs.

I want to get all linked issues recursively with all kinds of links, except for Epic Link (I don't want to get the epic of ABC-123) and except for sub-tasks (I don't want to include sub-tasks of ABC-123 or sub-tasks of A's linked issues)

I am using Adaptavist ScriptRunner and my first naive attempt was 

issueFunction in linkedIssuesOfRecursive("issue = ABC-123")

However ABC-123 is part of epic ABC-456 and this epic has dozens of stories inside it and as result I get 4000 issues

I compared this with JQL Tricks plugin (using linkedAllIssues("ABC-123")) and it returned 29 issues (which is correct from my definition)

Seems like JQL Tricks did not consider the epic as "linked issue" and did not "explode" that part of the tree.

I know that with ScriptRunner I can limit the list of linked issues by link type, but we have so many link types, that I don't want to write something like 

issueFunction in linkedIssuesOfRecursive("issue = ABC-123","blocks")
 OR issueFunction in linkedIssuesOfRecursive("issue = ABC-123", "is blocked by") 
 OR issueFunction in linkedIssuesOfRecursive("issue = ABC-123", "duplicates")
 OR issueFunction in linkedIssuesOfRecursive("issue = ABC-123", "is duplicated by")

etc.

 

Is there a way to instruct ScriptRunner to not follow specific type of links in that function?

Many thanks in advance.

 

P.S. Having both ScriptRunner and JQLT is out of question, due to cost restrictions

1 answer

1 accepted

1 vote
Answer accepted
Jamie Sawyer (Adaptavist)
Contributor
February 7, 2017

Hi Pavel,

This was a known issue with ScriptRunner for JIRA, and was resolved in version 4.3.15 as per https://productsupport.adaptavist.com/browse/SRJIRA-1329.  Following this, additional tools (the linkedIssuesOfAll* functions) were provided in 4.3.16 to provide the functionality that the linkedIssuesOf* functions provided prior to 4.3.15, as per https://productsupport.adaptavist.com/browse/SRJIRA-2146.

With this in mind, I would strongly recommend upgrading ScriptRunner to version 4.3.16 in your instance (which is compatible with JIRA 7.0.0 to 7.3.1), but please bear in mind the impact of the changes mentioned above in the contexts of other queries you may have in your system.

If you are unable to upgrade your version of ScriptRunner, the example you wrote above will unfortunately not work as it will navigate each chain separately:

Imagine a simple example where ABC-1 blocks ABC-2, which itself duplicates ABC-3, doing linkedIssuesOfRecursive("issue=ABC-1","blocks") will give us ABC-2 but not ABC-3, and linkedIssuesOfRecursive("issue=ABC-1","duplicates") will return neither ABC-2 nor ABC-3.

In this case, if you aren't able to upgrade ScriptRunner, you will either have to construct a custom JQL function (documentation can be found here, but bear in mind it will be effectively deprecated upon upgrade when a built-in function exists), or utilise JQL-Tricks.

Kind regards,

Jamie Sawyer

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events