Skip to content

Attachments

Upload, download, and manage file attachments on Jira issues.

  • Authenticated profile (atlcli auth login)
  • Jira permission: Browse Projects (view), Create Attachments (upload), Delete Attachments (delete)

View attachments on an issue:

Terminal window
atlcli jira issue attachments PROJ-123

Output:

ID FILENAME SIZE CREATED
10001 screenshot.png 245 KB 2025-01-14
10002 debug.log 12 KB 2025-01-13
10003 requirements.pdf 1.2 MB 2025-01-10

Use --json for JSON output.

Attach a file to an issue:

Terminal window
atlcli jira issue attach PROJ-123 ./screenshot.png

Upload multiple files:

Terminal window
atlcli jira issue attach PROJ-123 ./file1.png ./file2.pdf ./logs.zip

Options:

FlagDescription
--commentAdd a comment with the attachment
Terminal window
# Upload with comment
atlcli jira issue attach PROJ-123 ./error.log --comment "Error logs from production"
# Upload all screenshots
atlcli jira issue attach PROJ-123 ./screenshots/*.png

Download an attachment by ID or filename:

Terminal window
# By attachment ID
atlcli jira issue attachment download 10001 -o ./downloads/
# By filename from issue
atlcli jira issue attachment download PROJ-123 screenshot.png -o ./downloads/

Options:

FlagDescription
-o, --outputOutput directory or file path
--overwriteOverwrite existing files
Terminal window
# Download all attachments from an issue
atlcli jira issue attachments PROJ-123 --json | \
jq -r '.attachments[].id' | \
xargs -I {} atlcli jira issue attachment download {} -o ./downloads/

Remove an attachment:

Terminal window
atlcli jira issue attachment delete 10001 --confirm

Options:

FlagDescription
--confirmSkip confirmation prompt
Terminal window
atlcli jira issue attachments PROJ-123 --json
{
"schemaVersion": "1",
"issue": "PROJ-123",
"attachments": [
{
"id": "10001",
"filename": "screenshot.png",
"size": 250880,
"mimeType": "image/png",
"created": "2025-01-14T10:00:00Z",
"author": {
"displayName": "Alice",
"email": "alice@company.com"
},
"content": "https://company.atlassian.net/secure/attachment/10001/screenshot.png"
}
],
"total": 1
}

Jira accepts most file types. Common attachments include:

  • Images: PNG, JPG, GIF, SVG
  • Documents: PDF, DOCX, XLSX, TXT
  • Archives: ZIP, TAR.GZ
  • Logs: LOG, TXT
  • Code: Source files of any type
Terminal window
# Attach build log after CI failure
atlcli jira issue attach PROJ-123 ./build.log --comment "Build failed - see attached log"
Terminal window
# Export all attachments from issues matching JQL
for key in $(atlcli jira search --jql "project = PROJ AND attachments is not EMPTY" --json | jq -r '.issues[].key'); do
mkdir -p "./attachments/$key"
atlcli jira issue attachments $key --json | \
jq -r '.attachments[].id' | \
xargs -I {} atlcli jira issue attachment download {} -o "./attachments/$key/"
done
Terminal window
# Download from source issue
atlcli jira issue attachments PROJ-100 --json | \
jq -r '.attachments[].id' | \
xargs -I {} atlcli jira issue attachment download {} -o /tmp/migrate/
# Upload to target issue
atlcli jira issue attach PROJ-200 /tmp/migrate/*
Jira and Confluence are trademarks of Atlassian Corporation Plc. atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.