Describe the problem/error/question
Hello, I’m trying to build a workflow that reads emails and creates Jira issues with any email attachments, but I’m encountering an error when trying to attach files. The “Issue Attachment” tool always fails with the error message: Cannot read properties of undefined (reading '0')
.
What I’ve tried
I’ve verified that the email contains attachments and that the issue is being created successfully. The error only occurs during the attachment step. I’m using a Code node to process the binary data from the email before passing it to the Jira attachment node.
What is the error message (if any)?
Cannot read properties of undefined (reading '0')
The related log entry is :
{
"message": {
"channel": "web",
"context": {
"app": {
"name": "RudderLabs JavaScript SDK",
"namespace": "com.rudderlabs.javascript",
"version": "1.33.0"
},
"traits": {
"instance_id": "b1862f9c61dcf71c48b1a8ecb62b9c9bd55e3cd262e106f200158bfbf48e01c3"
},
"library": {
"name": "RudderLabs JavaScript SDK",
"version": "1.33.0"
},
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
"locale": "de-DE",
"os": {
"name": "",
"version": ""
},
"screen": {
"density": 2,
"width": 3360,
"height": 1890,
"innerWidth": 1828,
"innerHeight": 1402
},
"device": null,
"network": null,
"sessionId": 1743595041699,
"campaign": {},
"page": {
"path": "/workflow/VhuI6aOUn3vMmVx8",
"referrer": "$direct",
"referring_domain": "",
"search": "",
"title": "🔄 Create Jira Issue - n8n[DEV]",
"url": "/workflow/VhuI6aOUn3vMmVx8",
"tab_url": "/workflow/VhuI6aOUn3vMmVx8",
"initial_referrer": "$direct",
"initial_referring_domain": ""
},
"ip": "0.0.0.0"
},
"type": "track",
"messageId": "6b4e672c-d20c-4a42-9dc6-a54508ca5eb4",
"originalTimestamp": "2025-04-02T11:59:28.559Z",
"anonymousId": "41df77f8-c7f4-4901-90b7-980eedfc4f67",
"userId": "b1862f9c61dcf71c48b1a8ecb62b9c9bd55e3cd262e106f200158bfbf48e01c3#1abd5523-8209-44ba-9ea2-d281a2afef3b",
"event": "Manual exec errored",
"properties": {
"error_title": "Cannot read properties of undefined (reading '0')",
"node_type": "n8n-nodes-base.jiraTool",
"node_type_version": 1,
"node_id": "4768af9c-7d44-4d62-a599-97c789d3c0f9",
"node_graph_string": "{\"node_types\":[\"n8n-nodes-base.emailReadImap\",\"n8n-nodes-base.if\",\"@n8n/n8n-nodes-langchain.agent\",\"n8n-nodes-base.jiraTool\",\"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\"n8n-nodes-base.code\",\"n8n-nodes-base.jiraTool\"],\"node_connections\":[{\"start\":\"0\",\"end\":\"1\"},{\"start\":\"1\",\"end\":\"5\"},{\"start\":\"3\",\"end\":\"2\"},{\"start\":\"4\",\"end\":\"2\"},{\"start\":\"5\",\"end\":\"2\"},{\"start\":\"6\",\"end\":\"2\"}],\"nodes\":{\"0\":{\"id\":\"fec304ef-2e24-42d7-a824-a9da14ce4be4\",\"type\":\"n8n-nodes-base.emailReadImap\",\"version\":2,\"position\":[-420,-160]},\"1\":{\"id\":\"76e6cb9c-63b4-47de-b96d-5718a1dae7dd\",\"type\":\"n8n-nodes-base.if\",\"version\":2.2,\"position\":[-180,-160]},\"2\":{\"id\":\"ffc316e9-8cd0-4799-96e6-4bfc4740c809\",\"type\":\"@n8n/n8n-nodes-langchain.agent\",\"version\":1.8,\"position\":[200,-140],\"agent\":\"conversationalAgent\"},\"3\":{\"id\":\"7e14871d-75ef-402a-b565-ca17f8ac6550\",\"type\":\"n8n-nodes-base.jiraTool\",\"version\":1,\"position\":[380,180],\"operation\":\"create\",\"resource\":\"issue\"},\"4\":{\"id\":\"9f818d1e-1d07-4947-a190-f9310f545b6e\",\"type\":\"@n8n/n8n-nodes-langchain.lmChatOpenAi\",\"version\":1.2,\"position\":[160,120]},\"5\":{\"id\":\"91055e49-83f8-4099-aaf9-bfae3326445b\",\"type\":\"n8n-nodes-base.code\",\"version\":2,\"position\":[40,-220],\"mode\":\"runOnceForAllItems\"},\"6\":{\"id\":\"4768af9c-7d44-4d62-a599-97c789d3c0f9\",\"type\":\"n8n-nodes-base.jiraTool\",\"version\":1,\"position\":[580,100],\"operation\":\"add\",\"resource\":\"issueAttachment\"}},\"notes\":{},\"is_pinned\":false}",
"version_cli": "1.85.4"
},
"integrations": {
"All": true
},
"user_properties": null
}
}
Please share your workflow
Questions
- Is there something specific I need to do to prepare the binary data before passing it to the Jira attachment node?
- Is my ‘Code’ node correctly processing the email attachments?
- Does this error happen because the AI Agent isn’t properly passing the issue key to the jira_add_attachments node?
Share the output returned by the last node
Information on your n8n setup
- n8n version: 1.85.4
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main): main
- Running n8n via (Docker, npm, n8n cloud, desktop app): npx
- Operating system: Debian 12