Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,699
Community Members
 
Community Events
184
Community Groups

Delete everything under "Issue Links" using Scriptrunner (including external links)

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?

1 answer

1 accepted

0 votes
Answer accepted
John Chin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 27, 2021

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)

 

Screenshot 2021-01-27 at 14.55.22.png

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events