When to Use
- Attachment inventory audit: A compliance workflow retrieves metadata for known attachment IDs stored in a database to verify that required evidence files (e.g. signed approval PDFs) are still present and have not been deleted.
- Pre-delete verification: Before calling
attachment/remove, call attachment/get to confirm the attachment ID is correct and the file name matches what is expected. This prevents accidental deletion of the wrong attachment.
- File size monitoring: A storage management workflow retrieves metadata for recent attachments and alerts if any single attachment exceeds a size threshold (e.g. 8MB), warning before the Jira instance storage limit is approached.
- Attachment provenance verification: A security workflow checks that uploaded evidence files were authored by the expected automation service account by verifying the
author field in the attachment metadata.
- MIME type validation: Before archiving Jira attachments to S3, a workflow retrieves each attachment's metadata to confirm its MIME type, ensuring only expected file types (PDF, text/plain, image/*) are transferred.
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 |
AttachmentId | Required | The numeric Jira attachment ID to retrieve metadata for. Obtained from a prior attachment/add response or from attachment/getAll. Example: "10044". |
Metadata only — not file content: This operation returns attachment metadata (name, size, MIME type, timestamps). It does not download the file binary. To download file content, use the content URL from the Jira API response in an HttpRequest node with Basic Auth headers matching your Jira credentials.
Sample Configuration
{
"resource": "attachment",
"operation": "get",
"Host": "https://acmecorp.atlassian.net",
"Email": "automation@acmecorp.com",
"ApiToken": "{{ $credentials.jiraApiToken }}",
"AttachmentId": "{{ $json.attachmentId }}"
}
Validation Errors
| Error Code | Cause |
VAL_MISSING_ATTACHMENT_ID | AttachmentId is empty or null. |
ATTACHMENT_NOT_FOUND | No attachment exists with the given ID, or the user lacks access to the issue it belongs to. |
AUTH_FAILED | Invalid credentials or expired API token. |
Output Fields
| Field | Type | Description |
status | string | "success" or "error" |
attachmentId | string | Jira attachment ID. |
fileName | string | File name as stored in Jira. |
fileSize | integer | File size in bytes. |
mimeType | string | MIME type of the file. Example: "text/plain", "application/pdf", "image/png". |
created | string | ISO 8601 timestamp of when the attachment was uploaded. |
author | string | Display name of the user who uploaded the file. |
resource | string | Always "attachment" |
operation | string | Always "get" |
Sample Output
{
"status": "success",
"attachmentId": "10044",
"fileName": "incident-OPS-347-logs-2026-05-26-1430.txt",
"fileSize": 48312,
"mimeType": "text/plain",
"created": "2026-05-26T14:30:08.000Z",
"author": "BizFirst Automation",
"resource": "attachment",
"operation": "get"
}
Expression Reference
| Expression | Type | Example Value | Use |
{{ $output.getAttachment.fileName }} | string | File name | Confirm correct file before deletion |
{{ $output.getAttachment.fileSize }} | integer | 48312 | Storage audit and size threshold checks |
{{ $output.getAttachment.mimeType }} | string | "text/plain" | Validate file type before archiving |
{{ $output.getAttachment.author }} | string | "BizFirst Automation" | Verify upload provenance |
{{ $output.getAttachment.created }} | string | ISO timestamp | Age-based archival decisions |
Node Policies & GuardRails
- Attachment IDs must be stored from add responses: Jira does not provide a search-by-filename API for attachments. To retrieve a specific attachment, you must have stored its ID from the
attachment/add response in a persistent store.
- Use attachment/getAll for unknown IDs: If you don't have a specific ID, call
attachment/getAll on the issue to list all attachments and find the one you need.
- Downloading file content: To download the actual file binary, use the Jira attachment content endpoint (
GET /rest/api/3/attachment/content/{id}) via an HttpRequest node with the same Basic Auth credentials.
Workflow Example — Verify Before Delete
// Step 1: attachment/get — verify ID and filename match expected
{
"resource": "attachment",
"operation": "get",
"AttachmentId": "{{ $json.attachmentId }}"
}
// Step 2: IfCondition — filename matches pattern and author is automation account
// Condition: {{ $output.getAttachment.fileName }}.includes("test-run") AND {{ $output.getAttachment.author }} === "BizFirst Automation"
// Step 3 (if safe): attachment/remove
{
"resource": "attachment",
"operation": "remove",
"AttachmentId": "{{ $json.attachmentId }}"
}