How to get a list of all attachments


It is very easy to get a list of attachments for a single space, list of spaces, or all spaces for a site. This describes how to get attachment information even if are using On Demand version of JIRA. Download users could do something similar using an SQL based query on the JIRA database. The CLI provides the getAttachmentList action that produces a csv file with detail attachment information. There are a variety of subsetting options including by page using search and by attachment information using regex matching. Using --outputFormat 2 provides the most information.

Example Output

Single Space

--action getAttachmentList --space ACLI --file attachmentList.csv --outputFormat 2 --dateFormat yyyy-MM-dd

All Spaces

--action getAttachmentList --space @all --file attachmentList.csv --outputFormat 2 --dateFormat yyyy-MM-dd

List of Spaces

--action runFromList --list ACLI,BCLI --clearFileBeforeAppend --common "--action getAttachmentList --space @entry@ --file attachmentList.csv --append --outputFormat 2 --dateFormat yyyy-MM-dd"

Run CLI Actions in Confluence add-on

If you have the Run CLI Actions in Confluence, then the following will provide a page listing all the attachments. In this example, we sort by size descending.

--action getAttachmentList --space @all --outputFormat 2 --dateFormat yyyy-MM-dd --quiet