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,293,761
Community Members
 
Community Events
165
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

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 M 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
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

219 views 0 6
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you