Issue not accessible due to too many links in Jira Data Center
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When an issue has too many links, it can become very slow to load or even unavailable in the UI as detailed in Jira Software guardrails
The goal of this article is to provide ways to delete issue links.
Environment
Jira Data Center
Solution
Here are the methods of deleting issue links.
1 - User interface
When the UI is accessible, you can delete the links using the user interface:

2 - REST API
Using the REST API, we can send a DELETE request to the /rest/api/2/issuelink/{linkid} endpoint. More details about the endpoint at https://docs.atlassian.com/software/jira/docs/api/REST/9.17.0/#api/2/issueLink-deleteIssueLink
Here's an example of how to bulk delete the issue links using the REST API for the issue "ISSUE-123
".
Run this curl below to fetch the issue links:
1
curl -s -u admin:mypassword https://myjira.com/rest/api/2/issue/ISSUE-123 | jq '.fields.issuelinks[]|.self,.type.name,.outwardIssue.key,.inwardIssue.key' | grep -v null | sed 's/"//g' > issuelinks.txt
Verify the
issuelinks.txt
file and double-check that you wish to delete all issue links present in it. Remove issue links that should be preserved.To delete the issue links from the file, run this command below.
⚠️ Once the issue links are deleted, there is no way to restore them.
1
for i in $(egrep "(http)|(https)://.*issueLink" issuelinks.txt); do echo deleting $i; curl -u admin:mypassword -X DELETE $i; done
3 - Database
⚠️ We don't recommend performing the changes in the database directly, and this should be used as a last resort. Always back up your database before deleting data.
Deleting the links from the database have the drawbacks of increased risk and it causes the indexes to be outdated. Because each links is present in both issues in the index, all the related issues need to be reindexed, demanding a project or even full reindex to make sure the link-related searches are accurate.
In this example, we're deleting the links related to the issue "ISSUE-123
"
First, let's fetch all the issue links, to view the data we're about to delete. Notice we've specified the desired issue in the WHERE statement.
1 2 3 4 5 6 7 8 9 10
SELECT il.id as LinkID,ilt.linkname,CONCAT(p2.pkey,'-',i2.issuenum) AS Source,CONCAT(p3.pkey,'-',i3.issuenum) AS Destination FROM jiraissue i JOIN project p on i.project=p.id JOIN issuelink il ON (i.id=il.destination OR i.id=il.source) JOIN issuelinktype ilt ON ilt.id=il.linktype JOIN jiraissue i2 ON i2.id=il.source JOIN project p2 on i2.project=p2.id JOIN jiraissue i3 ON i3.id=il.destination JOIN project p3 on i3.project=p3.id WHERE p.pkey='ISSUE' AND i.issuenum=123
Take note of the projects the related issues are related. Also take notes of issue links that you wish to be preserved, if any.
Now, let's delete the issues. In this example, we're deleting all links except for 10721 and 10722
1 2 3 4 5 6 7 8
DELETE FROM issuelink WHERE id IN ( SELECT il.id FROM jiraissue i JOIN project p on i.project=p.id JOIN issuelink il ON (i.id=il.destination OR i.id=il.source) WHERE p.pkey='ISSUE' AND i.issuenum=123) AND id NOT IN (10721,10722)
Reindex all issues related to the links. You can re-index the related projects or run a full re-index.
Was this helpful?