Search for all issues where a linked issue is of type X

I've found the linkedIssues() function, but it requires an issue key i.e. it's limited to finding all linked issues of type X to a specific issue.  You don't appear to be able to wildcard it in any way. e.g issues in linkedIssues("BT-1","is duplicated by") works happily, but only for the root issue "BT-1".

I want to be able to generate a list of all issues having a linked issue where the link type is, say, "is duplicated by".

1 answer

2 votes
Alexey Matveev Community Champion Jan 04, 2018

Hello,

You would need an add-on. If you have Power Scripts add-on you could create a file hasLinks.sil with the following code

string [] keys = selectIssues(argv[0]);
string [] ret;
for(string k in keys) {
   for ( JIssueLink jLink in getIssueLinksDetail(k))  {
        if (jLink.description == argv[1]){
            ret += k;
        }
    }
}
return ret;

And then make a JQL query like this

key in silJQLList("hasLinks.sil", "project = SD", "is duplicated by")

You can read more about JQL functions in Power Scripts here

https://confluence.cprime.io/display/JJUPIN/JQL+Support

Thanks Alexey.

My reading of the Power Scripts documentation suggests it's only available for JIRA Server installations, not JIRA Cloud (which may be why I can't find it when I search for it in AddOns).  ??

Alexey Matveev Community Champion Jan 07, 2018

Yes, it is not available for Jira Cloud. If you are on Jira Cloud you could use Adaptivist ScriptRunner add-on. You could use a JQL like this

hasLinks = "is duplicated by"

You can read more here

http://scriptrunner-docs.connect.adaptavist.com/jiracloud/jql-aliases.html#_haslinks

Many thanks, Alexey.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

21,669 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you