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:

  1. We’ll remove excess attachments from your issue.

  2. We’ll add them to an archive, and attach it to the original issue.

  3. 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

Click here to expand...

SELECT
  fa.issueid AS issue_id,
  j.issuenum AS issue_key,
  COUNT(fa.id) AS attachment_count
FROM
  fileattachment fa
JOIN
  jiraissue j ON fa.issueid = j.id
GROUP BY
  fa.issueid, j.issuenum
HAVING
  COUNT(fa.id) > 2000
ORDER BY
  attachment_count DESC;

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:

  1. In Jira Data Center, go to Project Settings > Automation.

  2. Select Create rule.

  3. 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 value

{{issue.attachment.created}}

Condition

less than

Second value

2022-07-01T00:00:00.0+0000

Action

Delete attachments

The empty value means that all attachments that met the condition above will be deleted.

Filename

empty


The rule should look like this:

Option 2: Delete extra attachments with API

The following pages link to APIs used to delete attachments.

  1. Get attachment ID from an issue. To do this, you need to specify fields as attachmentsGET Get issue

  2. Delete an attachment based on its ID: DEL Delete attachment

Last modified on Oct 9, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.