Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.