Issues with too many attachments
This insight checks if any of your issues exceed the limit of attachments.
Why is there a limit?
Jira Cloud limits the number of attachments per issue, because adding unlimited entities often results in unusually large and complex data shapes, which in turn causes reliability and performance problems.
Migrations are exempted from this limit so they’re not blocked. However, after you migrate, we’ll automatically modify your issues, optimizing attachments above the limit in the following way:
We’ll remove excess attachments from your issue.
We’ll add them to an archive, and attach it to the original issue.
You won’t be able to add new attachments above the limit.
What’s the recommendation?
For active issues where you still add attachments, you can use the ideas below to reduce their number. However, it might be easier to let us remove excess attachments after you migrate and start fresh in new issues.
Delete extra attachments RECOMMENDATION
Jira doesn’t have an easy way to delete attachments in bulk. Below, we’ve added some ideas so you can check which one works for you.
Identify affected issues with SQL query
When viewing this recommendation from the dashboard, copy the provided SQL query and run it on your database.
The SQL query returns:
Issues with over 2,000 attachments
Attachment count for each issue_id
Option 1: Delete extra attachments with Jira automation (Data Center or Cloud)
You can delete attachments in bulk by using Jira automation, both in Data Center and Cloud.
Rule description
This (Data Center) rule deletes all attachments from an issue if they’re older than ~2 years. You can also modify it by changing the conditions or dates.
Before running it, you should clone your affected issues to keep the attachment history.
To create a rule that deletes old attachments:
In Jira Data Center, go to Project Settings > Automation.
Select Create rule.
Specify rule details as follows:
Rule component | Type | Additional details |
|---|---|---|
Trigger | Manual trigger from issue | This lets you run a rule directly from an issue. You can choose other types, like issue type or status. |
| Condition | Advanced compare | The smart value returns the creation date of attachments, the condition chooses attachments older than the specified date. First valueConditionless than Second value |
Action | Delete attachments | The empty value means that all attachments that met the condition above will be deleted. Filenameempty |
The rule should look like this:
Option 2: Delete extra attachments with API
The following pages link to APIs used to delete attachments.
Get attachment ID from an issue. To do this, you need to specify fields as
attachments: GET Get issueDelete an attachment based on its ID: DEL Delete attachment
