jira issue attachment download¶
- Usage:
jira issue attachment download KEY ATTACHMENT_ID [--to PATH] [flags]
Download one attachment by ID and write it to a file. Use it after attachment list when you need the file content locally.
Binary content is always written to a file, never stdout, so JSON output stays parseable. Existing target files are protected unless --force is set. --dry-run validates the target path and prints the planned write without downloading.
Safety¶
--dry-run¶
Preview without downloading
--force¶
Overwrite existing target file
Output¶
--to <PATH>¶
Write the attachment to PATH (default: current directory)
Accepts a file.
Output fields¶
With --output json, the response envelope's data object carries these fields. Run jira agent schema for the full machine-readable schema.
| Field | Type | Description |
|---|---|---|
attachment_id |
string | |
bytes |
integer | The number of bytes written by a successful live download. |
dry_run |
boolean | |
issue.id |
string | |
issue.key |
string | |
issue.self |
string | |
mode |
string | |
target |
string | The destination requested before any server-derived filename is applied. |
written_to |
string | The path written by a successful live download. |
Examples¶
jira issue attachment download PROJ-123 10500 # (1)!
jira issue attachment download PROJ-123 10500 --to ./report.pdf --force # (2)!
jira issue attachment download PROJ-123 10500 --to ./report.pdf --dry-run # (3)!
- Download an attachment to the current directory
- Download to a specific path, overwriting if it exists
- Preview the download target without contacting Jira