When to Use
- Attachment archival to S3: A quarterly archival workflow lists all attachments on closed issues older than 90 days. For each attachment, it downloads the content via
HttpRequest and uploads to S3 cold storage before calling attachment/remove to free Jira storage quota.
- Compliance evidence inventory: Before a compliance audit, a workflow calls
attachment/getAll on each change-request issue to verify that required documents (approval letter PDF, test evidence) are present and match expected file names and sizes.
- Duplicate attachment detection: Before adding a new file, a workflow lists existing attachments and checks if a file with the same name already exists. If found, it skips the upload to avoid accumulating identical files.
- Storage usage reporting: A monthly storage audit workflow iterates through all issues in a project, calls
attachment/getAll on each, sums all fileSize values, and reports total attachment storage consumption by project.
- Post-incident attachment review: After an incident is resolved, a post-mortem workflow lists all attachments to verify that log files, screenshots, and diagnostic dumps were properly captured and are available for retrospective analysis.
Configuration
Connection
| Field | Required | Description |
Host | Required | Jira instance base URL. Example: https://acmecorp.atlassian.net |
Email | Required | Atlassian account email. Example: automation@acmecorp.com |
ApiToken | Required | API token from Atlassian security settings. Store in Credentials Manager. |
Operation Fields
| Field | Required | Description |
IssueKey | Required | The key of the issue to list attachments for. Example: OPS-347. |
Sample Configuration
{
"resource": "attachment",
"operation": "getAll",
"Host": "https://acmecorp.atlassian.net",
"Email": "automation@acmecorp.com",
"ApiToken": "{{ $credentials.jiraApiToken }}",
"IssueKey": "{{ $json.issueKey }}"
}
Validation Errors
| Error Code | Cause |
VAL_MISSING_ISSUE_KEY | IssueKey is empty or null. |
ISSUE_NOT_FOUND | No issue exists with the given key, or the user lacks access. |
AUTH_FAILED | Invalid credentials or expired API token. |
Output Fields
| Field | Type | Description |
status | string | "success" or "error" |
attachments | array | Array of attachment metadata objects. Each has id, fileName, fileSize, mimeType, author, created. |
total | integer | Total number of attachments on the issue. |
issueKey | string | Issue key the attachments belong to. |
resource | string | Always "attachment" |
operation | string | Always "getAll" |
Sample Output
{
"status": "success",
"attachments": [
{
"id": "10044",
"fileName": "incident-OPS-347-logs-2026-05-26-1430.txt",
"fileSize": 48312,
"mimeType": "text/plain",
"author": "BizFirst Automation",
"created": "2026-05-26T14:30:08.000Z"
},
{
"id": "10045",
"fileName": "payment-gw-screenshot-2026-05-26.png",
"fileSize": 127448,
"mimeType": "image/png",
"author": "Sarah Chen",
"created": "2026-05-26T15:12:44.000Z"
}
],
"total": 2,
"issueKey": "OPS-347",
"resource": "attachment",
"operation": "getAll"
}
Expression Reference
| Expression | Type | Example Value | Use |
{{ $output.getAllAttachments.attachments }} | array | All attachment objects | Loop for archival or deletion |
{{ $output.getAllAttachments.total }} | integer | 2 | Check attachment count before processing |
{{ $output.getAllAttachments.attachments[0].id }} | string | "10044" | Pass to attachment/get or attachment/remove |
{{ $output.getAllAttachments.attachments.map(a => a.fileSize).reduce((s,n) => s+n, 0) }} | integer | Total bytes | Storage consumption reporting |
{{ $output.getAllAttachments.attachments.find(a => a.fileName.endsWith('.pdf')) }} | object | PDF attachment | Find the compliance document attachment |
Node Policies & GuardRails
- No pagination: All attachments are returned in a single response. Jira issues rarely have more than a few dozen attachments, so this is generally safe. For issues with many attachments, filter by MIME type or author in a Function node.
- Dedup check pattern: To prevent duplicate uploads, call
attachment/getAll first and check if any attachment's fileName matches the file you intend to upload. Only upload if no match is found.
- Empty attachments array is valid: If an issue has no attachments,
attachments will be an empty array and total will be 0. Guard downstream processing with a check on total > 0.
Workflow Example — Archival with Dedup Guard
// Step 1: attachment/getAll — list existing attachments
{
"IssueKey": "{{ $json.issueKey }}"
}
// Step 2: IfCondition — check if new file already exists
// Condition: !$output.getAllAttachments.attachments.some(a => a.fileName === $json.newFileName)
// Step 3 (if not duplicate): attachment/add
{
"IssueKey": "{{ $json.issueKey }}",
"FilePath": "{{ $json.filePath }}",
"FileName": "{{ $json.newFileName }}"
}
// Step 4 (if duplicate): log and skip — no upload needed