Forums

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

2GB Limit Reaching

Teena December 18, 2020

We are currently reaching 2GB limit in JIRA and would like to get a "List of JIRA Tickets with largest files" This will enable us to clean up for some space.

Please note the information can only be retrieved from the backend database which is only accessible by Altassian staff.

Teena George

 

1 answer

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2020

This does indeed need to go to Atlassian support, but they do not do support work for free or starter Cloud instances, and you will simply be redirected back here for help.

I'm not aware of any way to extract this data from Jira directly.   I think the best you could do would be to write a script that scrapes all of your issues over the REST API and reads each one for attachment information.

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2020

Yes, and...

You may find your issues having attachments using a query:

project = myProject AND attachments IS NOT EMPTY

And then iterate over them to get the attachment information using the REST API that Nic suggests:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/attachment-expandForHumans

Amir Sharobim
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 21, 2020

Thank you Nic and Bill.

Using linqPad i am able to use REST API to get an attachment detail given i know the attachment id.

I have a couple of issues:

1. authentication.  Using a token API  i am getting 401 unauthorized. (See code below).  what is wrong with how i am authenticating ? myEmail@somedomain.ca is email and wewewewewewe  is the API token

2. assuming i can get a list of all my jira tickets, how can i get a list of attachment ids for each issue ?  are there APIs for getting list of attachment for a given issue id ? 

void Main()
{
SortedSet<Result> myResult = new SortedSet<Result>(new AttachmentSizeComparer());
int[] ids = { 23623, 23625 };
var base64EncodedAuthorization = Convert.ToBase64String(Encoding.ASCII.GetBytes("myEmail@somedomain.ca:wewewewewewe"));
foreach (int i in ids)
{
using (System.Net.WebClient webClient = new System.Net.WebClient())
{
webClient.Headers.Set("Authorization", "Basic " + base64EncodedAuthorization);
var attachUrl = "https://durhamregion.atlassian.net/rest/api/2/attachment/" + i;
var jsonResult = webClient.DownloadString(attachUrl);
Attachment att = JsonConvert.DeserializeObject<Attachment>(jsonResult);
var newRes = new Result(i, att.Size);
myResult.Add(newRes);
}
}
myResult.Dump();
}

amir

Teena January 4, 2021

Hi, Would anyone be able to advise on the above .

Suggest an answer

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

Atlassian Community Events