Attachment size

Rahul Aich [Nagra]
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.
June 12, 2014

HI

I observe that in my jira instance more and more users are attaching huge log files.

Is there a way i can find out how many issues contain attachments in a certain period over 5 MB or say 10MB.

Rahul

1 answer

1 accepted

1 vote
Answer accepted
Matheus Fernandes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2014

Hi Rahul,

If you are running JIRA 6.1 or a newer version, this query should help:

SELECT p.pkey||'-'||ji.issuenum, filename, filesize FROM fileattachment fa 
	JOIN jiraissue ji ON ji.id = fa.issueid 
	JOIN project p ON ji.project = p.id
WHERE fa.created > '2014-01-01' AND filesize > '10485760';

If you are using older version, please try:

SELECT ji.pkey, filename, filesize FROM fileattachment fa 
	JOIN jiraissue ji ON ji.id = fa.issueid 
	JOIN project p ON ji.project = p.id
WHERE fa.created > '2014-01-01' AND filesize > '10485760';

Just replace "2014-01-01" with the date you want and '10485760' with the filesize (this is 10MB). Also, please note this was created using PostgreSQL, so you may need to adapt to other DBMSs - probably only on the first query to concatenate. :)

I hope this helps!

Rahul Aich [Nagra]
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.
July 30, 2014

Thanks Matheus, it works.

Suggest an answer

Log in or Sign up to answer