I have the situation that I want to completely purge all links under "Issue Links" for an issue. So far I only found code snippets on how to handle links to other issues, but I wonder how the groovy code must look like if I also want do delete links to external URLs and confluence pages. Is there an easy way to just "null" it?
Hi @flaimo , I hope I'm not late answering the question here. You can utilise the RemoteIssueLinkService method to do the validation and delete the remote issue link safely.
I found a few community answers that has some sample groovy script on it:
I was able to get the removeRemoteIssueLink function from the first post to work.
If you ever need to completely delete all issue links this is the code that works for me (inside an Automation rule)
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.RemoteIssueLinkManager
// remove jira links
ComponentAccessor.issueLinkManager.removeIssueLinksNoChangeItems(issue)
// remove external links
def rilm = ComponentAccessor.getComponentOfType(RemoteIssueLinkManager.class)
rilm.getRemoteIssueLinksForIssue(issue).each {
rilm.removeRemoteIssueLink(it.getId(), currentUser)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.