...
Description
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.
Tip |
---|
title | Use 3.5 or above for best results |
---|
|
Release 3.5 contains improvements in this area and is the base for the information on this page. |
Example Output
Csv |
---|
"Space","Title","Id","Parent Title","Parent Id","File Name","File Size","Content Type","Comment","Creator","Created","Url"
"ACLI","atlassian-cli-examples.png","32178288","Atlassian Command Line Interface","1966101","atlassian-cli-examples.png","20208","image/png","","bswift","2013-01-27","https://bobswift.atlassian.net/wiki/download/attachments/1966101/atlassian-cli-examples.png?version=1&modificationDate=1359302037514&api=v2"
"BCLI","bamboo-cli-banner.png","31457311","Bamboo Command Line Interface","2392068","bamboo-cli-banner.png","97283","image/png","","bswift","2013-01-16","https://bobswift.atlassian.net/wiki/download/attachments/2392068/bamboo-cli-banner.png?version=1&modificationDate=1358375409180&api=v2" |
Single Space
No Format |
---|
--action getAttachmentList --space ACLI --file attachmentList.csv --outputFormat 2 --dateFormat yyyy-MM-dd |
All Spaces
No Format |
---|
--action getAttachmentList --space @all --file attachmentList.csv --outputFormat 2 --dateFormat yyyy-MM-dd |
List of Spaces
No Format |
---|
--action runFromList --list ACLI,BCLI --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 CCLI, then the following will provide a page listing all the attachments. In this example, we sort by size descending.
No Format |
---|
{cache:refresh=7d|showRefresh=true|showDate=true}
{csv:macros=true|sortColumn=7|sortDescending=true|columnTypes=S,S,I,S,I,S,I,S,S,S,D,S}
{cli:profile=confluence|panel=false}
--action getAttachmentList --space @all --outputFormat 2 --dateFormat yyyy-MM-dd --quiet
{cli}
{csv}
{cache} |