The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

SQL to get attachment size with project key and issue key

Bhargavi Vasa
Contributor
July 15, 2024

I have SQL to get project key,issue key and attachment id's,looking for attachment size in byes in jira version 8.20.5

 

Example :

 

Project Key , Issuekey , Attachment ID, attachmentsize in bytes

 

SELECT

   p.pkey AS project_key,

   ji.issuenum AS issue_key,

   fa.id AS attachment_id

FROM

project p

JOIN

   jiraissue ji ON p.id = ji.project

JOIN

   fileattachment fa ON ji.id = fa.issueid

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
July 15, 2024

There's a "filesize" field in the "fileattachment" table, add it as part of your SELECT statement and that might get you what you want.