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,465,762
Community Members
 
Community Events
176
Community Groups

Is there any way to delete bulk issue links at all once?

Hi, I wanted to delete almost 8000 issue links from my ticket. Is there any option to delete the links other than doing it manually?

2 answers

1 accepted

1 vote
Answer accepted

Hi @Kruthika R

In your comment, you mentioned:-

Hi, I wanted to delete almost 8000 issue links from my ticket. 

Are all the 8000 issue links from one specific issue?

If yes, you could try something like this in the ScriptRunner console:-

import com.atlassian.jira.component.ComponentAccessor

def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueManager = ComponentAccessor.issueManager
def issueLinkManager = ComponentAccessor.issueLinkManager
def projectManager = ComponentAccessor.projectManager

//Specify your Project Key
def project = projectManager.getProjectByCurrentKey('MOCK')

def issues = issueManager.getIssueObjects(issueManager.getIssueIdsForProject(project.id))

issues.each {
if (it.key == 'MOCK-1') {
issueLinkManager.removeIssueLinks(it, loggedInUser)
}
}

Else if it is from multiple issues, you will need to do this:-

import com.atlassian.jira.component.ComponentAccessor

def loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def issueManager = ComponentAccessor.issueManager
def issueLinkManager = ComponentAccessor.issueLinkManager
def projectManager = ComponentAccessor.projectManager

//Specify your Project Key
def project = projectManager.getProjectByCurrentKey('MOCK')

def issues = issueManager.getIssueObjects(issueManager.getIssueIdsForProject(project.id))

issues.each {
issueLinkManager.removeIssueLinks(it, loggedInUser)
}

Please note that the sample working code above is not 100% exact to your environment. Hence, you will need to make the required modifications.

You will need to modify the project's key accordingly before triggering the code in the ScriptRunner console.

I have done a basic test of removing 1000 links at once in my environment.

I hope this helps to answer your question. :)

Thank you and Kind regards,

Ram

Hi @Ram Kumar Aravindakshan _Adaptavist_ ,Thanks for the script. But I still couldn't delete the issue Links

The issue Links are from the same issue. I have attached the image of the issue Link which still exist even after running the code.issue link.JPG

Hi @Kruthika R

In your comment, you mentioned:-

The issue Links are from the same issue. I have attached the image of the issue Link which still exist even after running the code.

If it is from only one issue, you can use the first example code that I have provided.

Please confirm, i.e. what are the issue link type(s) associated with your issue? Is it only one type as shown on your print screen?

Also, could you please provide a print screen of your Issue Links configuration as shown in the example below:-

issue_links.png

Thank you and Kind regards,

Ram

HI @Ram Kumar Aravindakshan _Adaptavist_ ,

Yes it is from one issue. we aren't aware of the issue link type and issue link configuration since it has been coming from Gitlab Integration. You can see the attached screenshot above.

Also I have tried with the code you sent it runs without any errors but no actions has been performed on the issue, The issue links still exists.

 

Thanks,

Kruthika

Hi @Kruthika R

As requested in my previous comment:-

Also, could you please provide a print screen of your Issue Links configuration as shown in the example below:-

issue_links.png

Please provide a print screen of your Issue Links configuration. This is to confirm whether the links you have displayed on your print screen, as shown below, are provided by Jira.

Capture2.png

If the link does not exist on the Issue Links configuration page, it cannot be removed from Jira using ScriptRunner. Instead, you need to remove it from GitLab.

FYI, a ticket for this has also been created on GitLab

Thank you and Kind regards,

Ram

0 votes
Bibek Behera Community Leader Apr 08, 2022

Hi @Kruthika R .

This video has all you need for now,

https://www.youtube.com/watch?v=9-v_8IgzoZQ

If you get stuck at any place you can make use of the similar discussion in the community in the past.

https://community.atlassian.com/t5/Jira-Software-questions/Deleting-all-issues-at-once/qaq-p/1659450

Thanks to @John Funk  :) 

Hi @Bibek Behera , Thanks for reaching out.

But I wanted to delete the issue links that is associated to an single issue. I am doing it manually as of now But I wanted to know if there is any other option to bulk delete of issue links.

Bibek Behera Community Leader Apr 08, 2022

@Kruthika R ,

I don't think the same is available out of the box to unlink all the issue at once without using some automation. If this is once is a while case I would suggest you to do it manually as accidental deletion of links would be hard to trace in a list of 8000 links.

Like Kruthika R likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events