Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Number of Attachments

jovanio_junior
Contributor
January 23, 2025

 

Is it possible to create a report or some app that can tell me which projects are taking up the most space in my instance? For example, the xpto project has 5k attachments, the xrth project has 2k attachments, and so on.

2 answers

3 votes
Gaurav Arora
Community Champion
January 23, 2025

Hi @jovanio_junior , Greetings!

A suggestion ticket is already in place with Atlassian. You can vote for it here -> JRACLOUD-75922

Also, you can refer to the discussion here -> https://community.atlassian.com/t5/Jira-questions/I-can-t-find-where-to-see-how-much-storage-our-project-has-used/qaq-p/2042479

BR,

Gaurav

1 vote
Akash Singh
Community Champion
January 23, 2025

@jovanio_junior  As Gaurav mentioned, there is no out-of-the-box way to determine which projects take up the most space in your instance unless you install a third-party app, which would simplify this process significantly. However, if you're comfortable with programming, you can leverage the Jira Expression API to evaluate attachment counts and their sizes for each project.

The Jira Expression API allows you to execute custom logic on a set of issues retrieved via JQL. Here’s how you can approach this problem:

  1. Understand Jira Expressions:

  2. Set Up the Query:

    • Start by running the API for a specific project using the JQL project = "xpto".
    • The results are paginated, so if a project has more than 1000 issues, you’ll need to iterate through the results using the nextPageToken.
  3. Jira Expression:

    • Below is an expression to calculate the total number of attachments and their combined size (in MB):

issues.reduce((result, issue) => {

    let issueAttachmentCount = issue.attachments.length;

    

    // Calculate attachment size in megabytes

    let issueAttachmentSize = issue.attachments.reduce((size, attachment) => size + attachment.size, 0) / 1048576;

 

    return {

        totalAttachments: result.totalAttachments + issueAttachmentCount,

        totalSize: result.totalSize + issueAttachmentSize

    };

}, { totalAttachments: 0, totalSize: 0 })

This expression sums up the number of attachments across all issues and calculates the total size of attachments in MB.

    4. Iterate Across Projects:

  • Repeat this process for each project by modifying the JQL dynamically (project = "<project-key>") and aggregating the results.

Example Output:

Using the above logic, you will receive response for each request where the value attribute will provide the required data:

exampleOutput.png

This method, while requiring some coding effort, can give you detailed insights into how much space each project is consuming without relying on third-party apps.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events