SQL query to get the details of attachments uploaded in Jira issues for configurable number of days or months.
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
In this article, we will outline a scenario in which users seek to retrieve attachment details from Jira tickets for a customizable duration of time, be it days or months.
Environment
Jira Software 8.x, 9.x
Solution
The following query retrieves the details of attachments for all Jira issues. Users have the flexibility to set the date according to their specific requirements.
1
2
3
4
5
6
7
8
9
10
11
12
13
select
fa.id,
fa.filename,
p.pkey as project,
ji.issuenum
from
fileattachment fa
join jiraissue ji on
ji.id = fa.issueid
join project p on
p.id = ji.project
where
fa.created > '2023-10-17 07:55';
Was this helpful?