How to Process Two Nodes in a Single Code Node

Describe the problem/error/question


Hello, I’m trying to download Excel files from two Jira nodes, convert them to JSON in a single code node, and then write a comment in Jira with some of the content.

I’ve written the code, but I’m encountering an error with the second “data1”.

Since I’m a beginner developer, I might be missing something.
I would greatly appreciate it if someone could point out the issue.

Thank you in advance for your help! Have a great day! :grinning:

Webhook OUTPUT:

[
  {
    "headers": {
      "content-type": "application/json",
      "user-agent": "Automation for Jira AC app/1.0",
      "content-length": "13320",
      "host": "localhost:5678",
      "connection": "Keep-Alive",
      "accept-encoding": "gzip,deflate"
    },
    "params": {},
    "query": {},
    "body": {
      "self": "http://localhost:8080/rest/api/2/issue/10229",
      "id": 10229,
      "key": "JSM-43",
      "changelog": {
        "startAt": 0,
        "maxResults": 0,
        "total": 0,
        "histories": null
      },
      "fields": {
        "issuetype": {
          "self": "http://localhost:8080/rest/api/2/issuetype/10008",
          "id": 10008,
          "description": "고객 지원 이슈 용도. Jira Service Management에서 만들었습니다.",
          "iconUrl": "http://localhost:8080/secure/viewavatar?size=xsmall&avatarId=10641&avatarType=issuetype",
          "name": "지원",
          "subtask": false,
          "fields": null,
          "statuses": [],
          "namedValue": "지원"
        },
        "timespent": null,
        "project": {
          "self": "http://localhost:8080/rest/api/2/project/10001",
          "id": 10001,
          "key": "JSM",
          "name": "JSM",
          "description": null,
          "avatarUrls": {
            "48x48": "http://localhost:8080/secure/projectavatar?avatarId=10324",
            "24x24": "http://localhost:8080/secure/projectavatar?size=small&avatarId=10324",
            "16x16": "http://localhost:8080/secure/projectavatar?size=xsmall&avatarId=10324",
            "32x32": "http://localhost:8080/secure/projectavatar?size=medium&avatarId=10324"
          },
          "issuetypes": null,
          "projectCategory": null,
          "email": null,
          "lead": null,
          "components": null,
          "versions": null,
          "projectTypeKey": "service_desk",
          "simplified": false
        },
        "fixVersions": [],
        "aggregatetimespent": null,
        "resolution": null,
        "customfield_10112": null,
        "customfield_10113": null,
        "customfield_10114": [],
        "customfield_10104": null,
        "customfield_10108": null,
        "customfield_10109": null,
        "resolutiondate": null,
        "workratio": -1,
        "lastViewed": "2024-10-16T03:37:55.771+0900",
        "watches": {
          "self": "http://localhost:8080/rest/api/2/issue/JSM-43/watchers",
          "watchCount": 1,
          "isWatching": true
        },
        "created": 1728657174000,
        "priority": {
          "self": "http://localhost:8080/rest/api/2/priority/3",
          "id": 3,
          "name": "Medium",
          "iconUrl": "http://localhost:8080/images/icons/priorities/medium.svg",
          "namedValue": "Medium"
        },
        "customfield_10100": null,
        "customfield_10101": null,
        "customfield_10102": null,
        "customfield_10300": null,
        "labels": [],
        "customfield_10103": null,
        "customfield_10214": "JSM-34",
        "customfield_10215": null,
        "customfield_10216": null,
        "customfield_10217": null,
        "timeestimate": null,
        "aggregatetimeoriginalestimate": null,
        "versions": [],
        "issuelinks": [
          {
            "id": 10200,
            "type": {
              "id": 10003,
              "name": "Relates",
              "inward": "relates to",
              "outward": "relates to"
            },
            "outwardIssue": null,
            "inwardIssue": {
              "self": "http://localhost:8080/rest/api/2/issue/10023",
              "id": 10023,
              "key": "JSM-1",
              "changelog": {
                "startAt": 0,
                "maxResults": 0,
                "total": 0,
                "histories": null
              },
              "fields": {
                "summary": "무엇을 찾고 있습니까?",
                "status": {
                  "self": "http://localhost:8080/rest/api/2/status/10003",
                  "description": "워크플로 가져오기 중에 Jira Service Management에서 자동으로 생성되었습니다.",
                  "iconUrl": "http://localhost:8080/images/icons/status_generic.gif",
                  "name": "지원 대기 중",
                  "id": 10003,
                  "statusCategory": {
                    "self": "http://localhost:8080/rest/api/2/statuscategory/4",
                    "id": 4,
                    "key": "indeterminate",
                    "colorName": "inprogress",
                    "name": "진행 중"
                  }
                },
                "priority": {
                  "self": "http://localhost:8080/rest/api/2/priority/10000",
                  "id": 10000,
                  "name": "블로커",
                  "iconUrl": "http://localhost:8080/images/icons/priorities/blocker.svg",
                  "namedValue": "블로커"
                },
                "issuetype": {
                  "self": "http://localhost:8080/rest/api/2/issuetype/10008",
                  "id": 10008,
                  "description": "고객 지원 이슈 용도. Jira Service Management에서 만들었습니다.",
                  "iconUrl": "http://localhost:8080/secure/viewavatar?size=xsmall&avatarId=10641&avatarType=issuetype",
                  "name": "지원",
                  "subtask": false,
                  "fields": null,
                  "statuses": [],
                  "namedValue": "지원"
                }
              },
              "renderedFields": null
            },
            "issue": {
              "self": "http://localhost:8080/rest/api/2/issue/10023",
              "id": 10023,
              "key": "JSM-1",
              "changelog": {
                "startAt": 0,
                "maxResults": 0,
                "total": 0,
                "histories": null
              },
              "fields": {
                "summary": "무엇을 찾고 있습니까?",
                "status": {
                  "self": "http://localhost:8080/rest/api/2/status/10003",
                  "description": "워크플로 가져오기 중에 Jira Service Management에서 자동으로 생성되었습니다.",
                  "iconUrl": "http://localhost:8080/images/icons/status_generic.gif",
                  "name": "지원 대기 중",
                  "id": 10003,
                  "statusCategory": {
                    "self": "http://localhost:8080/rest/api/2/statuscategory/4",
                    "id": 4,
                    "key": "indeterminate",
                    "colorName": "inprogress",
                    "name": "진행 중"
                  }
                },
                "priority": {
                  "self": "http://localhost:8080/rest/api/2/priority/10000",
                  "id": 10000,
                  "name": "블로커",
                  "iconUrl": "http://localhost:8080/images/icons/priorities/blocker.svg",
                  "namedValue": "블로커"
                },
                "issuetype": {
                  "self": "http://localhost:8080/rest/api/2/issuetype/10008",
                  "id": 10008,
                  "description": "고객 지원 이슈 용도. Jira Service Management에서 만들었습니다.",
                  "iconUrl": "http://localhost:8080/secure/viewavatar?size=xsmall&avatarId=10641&avatarType=issuetype",
                  "name": "지원",
                  "subtask": false,
                  "fields": null,
                  "statuses": [],
                  "namedValue": "지원"
                }
              },
              "renderedFields": null
            },
            "inward": true
          }
        ],
        "assignee": null,
        "updated": 1729017476000,
        "status": {
          "self": "http://localhost:8080/rest/api/2/status/10004",
          "description": "워크플로 가져오기 중에 Jira Service Management에서 자동으로 생성되었습니다.",
          "iconUrl": "http://localhost:8080/images/icons/status_generic.gif",
          "name": "고객 대기 중",
          "id": 10004,
          "statusCategory": {
            "self": "http://localhost:8080/rest/api/2/statuscategory/4",
            "id": 4,
            "key": "indeterminate",
            "colorName": "inprogress",
            "name": "진행 중"
          }
        },
        "components": [],
        "timeoriginalestimate": null,
        "description": null,
        "customfield_10210": [
          "[정보통신] 학생회비 환급 (ORG-28)"
        ],
        "customfield_10211": "1728657170724_10100_데이터이해와활용영역_충북대.pdf",
        "customfield_10212": null,
        "timetracking": {
          "originalEstimate": null,
          "remainingEstimate": null,
          "timeSpent": null,
          "originalEstimateSeconds": 0,
          "remainingEstimateSeconds": 0,
          "timeSpentSeconds": 0
        },
        "archiveddate": null,
        "customfield_10213": null,
        "customfield_10203": null,
        "customfield_10204": null,
        "security": {
          "self": "http://localhost:8080/rest/api/2/securitylevel/10000",
          "id": 10000,
          "name": "정통임원",
          "description": "",
          "namedValue": "정통임원"
        },
        "customfield_10205": null,
        "customfield_10206": null,
        "customfield_10207": null,
        "aggregatetimeestimate": null,
        "customfield_10208": null,
        "customfield_10209": null,
        "summary": "테스트",
        "creator": {
          "self": "http://localhost:8080/rest/api/2/user?username=test",
          "name": "test",
          "key": "JIRAUSER10100",
          "accountId": null,
          "emailAddress": "[email protected]",
          "avatarUrls": {
            "48x48": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=48",
            "24x24": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=24",
            "16x16": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=16",
            "32x32": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=32"
          },
          "displayName": "test",
          "active": true,
          "timeZone": "Asia/Seoul",
          "groups": null,
          "locale": null
        },
        "subtasks": [],
        "reporter": {
          "self": "http://localhost:8080/rest/api/2/user?username=test",
          "name": "test",
          "key": "JIRAUSER10100",
          "accountId": null,
          "emailAddress": "[email protected]",
          "avatarUrls": {
            "48x48": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=48",
            "24x24": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=24",
            "16x16": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=16",
            "32x32": "https://www.gravatar.com/avatar/b642b4217b34b1e8d3bd915fc65c4452?d=mm&s=32"
          },
          "displayName": "test",
          "active": true,
          "timeZone": "Asia/Seoul",
          "groups": null,
          "locale": null
        },
        "customfield_10120": null,
        "customfield_10000": "{summaryBean=com.atlassian.jira.plugin.devstatus.rest.SummaryBean@580ac341[summary={pullrequest=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6c7112fc[overall=PullRequestOverallBean{stateCount=0, state='OPEN', details=PullRequestOverallDetails{openCount=0, mergedCount=0, declinedCount=0}},byInstanceType={}], build=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@5320e809[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BuildOverallBean@37a2e663[failedBuildCount=0,successfulBuildCount=0,unknownBuildCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], review=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@10576fc0[overall=com.atlassian.jira.plugin.devstatus.summary.beans.ReviewsOverallBean@3c040ae6[stateCount=0,state=<null>,dueDate=<null>,overDue=false,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], deployment-environment=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@68b0ddcf[overall=com.atlassian.jira.plugin.devstatus.summary.beans.DeploymentOverallBean@4881bf44[topEnvironments=[],showProjects=false,successfulCount=0,count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], repository=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@6383e0fb[overall=com.atlassian.jira.plugin.devstatus.summary.beans.CommitOverallBean@7f4c9557[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}], branch=com.atlassian.jira.plugin.devstatus.rest.SummaryItemBean@11fc61d4[overall=com.atlassian.jira.plugin.devstatus.summary.beans.BranchOverallBean@54429730[count=0,lastUpdated=<null>,lastUpdatedTimestamp=<null>],byInstanceType={}]},errors=[],configErrors=[]], devSummaryJson={\"cachedValue\":{\"errors\":[],\"configErrors\":[],\"summary\":{\"pullrequest\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":\"OPEN\",\"details\":{\"openCount\":0,\"mergedCount\":0,\"declinedCount\":0,\"total\":0},\"open\":true},\"byInstanceType\":{}},\"build\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"failedBuildCount\":0,\"successfulBuildCount\":0,\"unknownBuildCount\":0},\"byInstanceType\":{}},\"review\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"stateCount\":0,\"state\":null,\"dueDate\":null,\"overDue\":false,\"completed\":false},\"byInstanceType\":{}},\"deployment-environment\":{\"overall\":{\"count\":0,\"lastUpdated\":null,\"topEnvironments\":[],\"showProjects\":false,\"successfulCount\":0},\"byInstanceType\":{}},\"repository\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}},\"branch\":{\"overall\":{\"count\":0,\"lastUpdated\":null},\"byInstanceType\":{}}}},\"isStale\":false}}",
        "customfield_10121": {
          "id": "1",
          "name": "해결시간",
          "_links": {
            "self": "http://localhost:8080/rest/servicedeskapi/request/10229/sla/1"
          },
          "completedCycles": [],
          "ongoingCycle": {
            "startTime": {
              "iso8601": "2024-10-11T23:32:54+0900",
              "jira": "2024-10-11T23:32:54.487+0900",
              "friendly": "5일 전 오후 11:32",
              "epochMillis": 1728657174487
            },
            "breachTime": {
              "iso8601": "2024-10-16T17:00:00+0900",
              "jira": "2024-10-16T17:00:00.000+0900",
              "friendly": "13시간이내",
              "epochMillis": 1729065600000
            },
            "breached": false,
            "paused": false,
            "withinCalendarHours": false,
            "goalDuration": {
              "millis": 86400000,
              "friendly": "24시간"
            },
            "elapsedTime": {
              "millis": 57600000,
              "friendly": "16시간"
            },
            "remainingTime": {
              "millis": 28800000,
              "friendly": "8시간"
            }
          }
        },
        "aggregateprogress": {
          "progress": 0,
          "total": 0
        },
        "customfield_10122": {
          "id": "2",
          "name": "최초 응답 시간",
          "_links": {
            "self": "http://localhost:8080/rest/servicedeskapi/request/10229/sla/2"
          },
          "completedCycles": [
            {
              "startTime": {
                "iso8601": "2024-10-11T23:32:54+0900",
                "jira": "2024-10-11T23:32:54.487+0900",
                "friendly": "5일 전 오후 11:32",
                "epochMillis": 1728657174487
              },
              "stopTime": {
                "iso8601": "2024-10-16T03:21:59+0900",
                "jira": "2024-10-16T03:21:59.000+0900",
                "friendly": "31분 전",
                "epochMillis": 1729016519000
              },
              "breached": true,
              "goalDuration": {
                "millis": 28800000,
                "friendly": "8시간"
              },
              "elapsedTime": {
                "millis": 57600000,
                "friendly": "16시간"
              },
              "remainingTime": {
                "millis": -28800000,
                "friendly": "-8시간"
              }
            }
          ]
        },
        "customfield_10200": "1728657172950_10100_데이터이해와활용영역_충북대.pdf",
        "customfield_10201": null,
        "customfield_10202": "1729009625784_10000_24년도 온점 2학기 1차 예산변경신청서.xlsx",
        "customfield_10115": {
          "_links": {
            "jiraRest": "http://localhost:8080/rest/api/2/issue/10229",
            "web": "http://localhost:8080/servicedesk/customer/portal/1/JSM-43",
            "self": "http://localhost:8080/rest/servicedeskapi/request/10229"
          },
          "requestType": {
            "id": "3",
            "_links": {
              "self": "http://localhost:8080/rest/servicedeskapi/servicedesk/1/requesttype/3"
            },
            "name": "증빙 서류 제출",
            "description": "저희 상품을 써 보시고 더 많은 정보를 알고 싶으신가요? 이것을 선택하세요. 문의사항을 최선을 다해 도와드리겠습니다.",
            "helpText": "",
            "serviceDeskId": "1",
            "groupIds": [
              "1"
            ],
            "icon": {
              "id": "10627",
              "_links": {
                "iconUrls": {
                  "48x48": "http://localhost:8080/secure/viewavatar?avatarType=SD_REQTYPE&size=large&avatarId=10627",
                  "24x24": "http://localhost:8080/secure/viewavatar?avatarType=SD_REQTYPE&size=small&avatarId=10627",
                  "16x16": "http://localhost:8080/secure/viewavatar?avatarType=SD_REQTYPE&size=xsmall&avatarId=10627",
                  "32x32": "http://localhost:8080/secure/viewavatar?avatarType=SD_REQTYPE&size=medium&avatarId=10627"
                }
              }
            }
          },
          "currentStatus": {
            "status": "고객 대기 중",
            "statusDate": {
              "iso8601": "2024-10-16T03:21:59+0900",
              "jira": "2024-10-16T03:21:59.000+0900",
              "friendly": "31분 전",
              "epochMillis": 1729016519000
            }
          }
        },
        "customfield_10116": [
          {
            "id": "1",
            "name": "테스트",
            "_links": {
              "self": "http://localhost:8080/rest/servicedeskapi/organization/1"
            }
          }
        ],
        "environment": null,
        "customfield_10117": null,
        "customfield_10118": null,
        "customfield_10119": [],
        "duedate": null,
        "progress": {
          "progress": 0,
          "total": 0
        },
        "votes": {
          "self": "http://localhost:8080/rest/api/2/issue/JSM-43/votes",
          "votes": 0,
          "hasVoted": false
        },
        "archivedby": null
      },
      "renderedFields": {}
    },
    "webhookUrl": "http://localhost:5678/webhook-test/1f0e032c-e8e2-463a-aa90-86dadba3cbd4",
    "executionMode": "test"
  }
]

What is the error message (if any)?

Problem in node ‘Code1‘

Cannot read properties of undefined (reading ‘data’) [line 8]

Please share your workflow

Share the output returned by the last node



Information on your n8n setup

  • n8n version: 1.60.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own, main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker desktop app
  • Operating system: macOS

hello @kdh949

The code node doesn’t accept multiple inputs. This one is correct

1 Like

Thank you so much for your help!

@barn4k Hello,

If it’s okay with you, could you let me know how to access the two files output from the merge node in the code node?

I changed the workflow as you suggested, but I’m still getting an error. :cry:

image

I solved it by converting JSON before merging!

why are you using the js library for converting excel to json if there is an Extract from file node that can do it for you? :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.