Need to get a list of remote issue links from within a Groovy script post function

On an issue close transition, I've got a groovy post function that creates a remote issue link to another application. That part works no problem. But I'm worried about what happens when someone reopens the issue and then closes it later... I want to check for any existing remote issue links and ensure the link hasn't already been created. How do I search the remote issue links? I can't seem to figure out how to get a list... I've been searching the API documentation and I found:

RemoteIssueLinkManager.getRemoteIssueLinksForIssue()

It looks like exactly what I want... but I can't figure out how to get an instance of RemoteIssueLinkManager. If I try:

RemoteIssueLinkManager remoteIssueLinkManager = new RemoteIssueLinkManager()

I get an error because it is an abstract class. What is the right way to get an instance of a remote issue link manager? Or is there a better way to get a List of RemoteIssueLinks for a given issue?

Thanks in advance!

1 answer

1 accepted

Nevermind... I figured out that I could use RemoteIssueLinkService:

RemoteIssueLinkService remoteIssueLinkService = ComponentManager.getComponentInstanceOfType(RemoteIssueLinkService.class)
RemoteIssueLinkService.RemoteIssueLinkListResult links = remoteIssueLinkService.getRemoteIssueLinksForIssue(currentUser, issue)

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,095 views 13 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot