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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:-
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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:-
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.