{
  "id": "EA4KBc02CzW5rsGe",
  "name": "Jira Knowledge Sync - Minimal (Summary \u2192 Comment & Assignee)",
  "tags": [],
  "nodes": [
    {
      "id": "145032ef-4fe8-41f5-826b-28ccdb708f0a",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1500,
        60
      ],
      "parameters": {
        "text": "=# \u30bf\u30a4\u30c8\u30eb\n{{ $('Code1').first().json.summary }}\n\n# \u8aac\u660e\n{{ $('Code1').first().json.description }}\n\n# \u30b3\u30e1\u30f3\u30c8\u5c65\u6b74\n{{ $json.comments }}",
        "options": {
          "systemMessage": "\u3042\u306a\u305f\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u958b\u767a\u8005\u3067\u3059\u3002\u30bf\u30b9\u30af\u304c\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u307e\u3057\u305f\u3002\u904e\u53bb\u306e\u77e5\u898b\u3092\u5229\u7528\u3057\u3066\u5bfe\u5fdc\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002output\u306e\u5185\u5bb9\u3092\u305d\u306e\u307e\u307eJira\u306e\u30b3\u30e1\u30f3\u30c8\u6b04\u306b\u8a18\u8f09\u3057\u307e\u3059\u3002\u307e\u305f\u95a2\u9023\u3059\u308b\u904e\u53bb\u306e\u77e5\u898b\u306fID\u3082\u5408\u308f\u305b\u3066\u56de\u7b54\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
        },
        "promptType": "define"
      },
      "typeVersion": 2
    },
    {
      "id": "a535a477-1dff-40ec-b9ab-5ef39ae7df81",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1460,
        260
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "notesInFlow": false,
      "typeVersion": 1.2
    },
    {
      "id": "08e9c208-9c18-44a8-977c-7aaeef659ff5",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        1600,
        260
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "id",
          "value": "<Pinecone Index\u3092\u5165\u529b>"
        },
        "toolDescription": "jira\u60c5\u5831"
      },
      "typeVersion": 1.3
    },
    {
      "id": "c667b76b-e39f-4d2d-9fb8-090c6714fe14",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        1640,
        400
      ],
      "parameters": {
        "options": {
          "dimensions": 1536
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "58583546-0717-44f7-8c0a-1439e41c5777",
      "name": "Jira Issue List",
      "type": "n8n-nodes-base.jira",
      "position": [
        160,
        0
      ],
      "parameters": {
        "options": {
          "jql": "assignee = \uff1c\u30a2\u30ab\u30a6\u30f3\u30c8ID\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1e"
        },
        "operation": "getAll"
      },
      "typeVersion": 1
    },
    {
      "id": "7fe43277-2fe6-4d17-ae59-43f5bd76d63b",
      "name": "Jira Issue Detail",
      "type": "n8n-nodes-base.jira",
      "position": [
        780,
        220
      ],
      "parameters": {
        "limit": 5,
        "options": {},
        "issueKey": "={{ $json.id }}",
        "resource": "issueComment",
        "operation": "getAll"
      },
      "typeVersion": 1
    },
    {
      "id": "23f2d27a-d245-45c2-b168-afd4285342ad",
      "name": "Jira Add Comment",
      "type": "n8n-nodes-base.jira",
      "position": [
        1980,
        260
      ],
      "parameters": {
        "comment": "={{ $json.output }}",
        "options": {},
        "issueKey": "={{ $('Code1').first().json.id }}",
        "resource": "issueComment"
      },
      "typeVersion": 1
    },
    {
      "id": "36551197-cca6-4d18-aca1-cb8e9c20c65c",
      "name": "Jira Assign",
      "type": "n8n-nodes-base.jira",
      "position": [
        2180,
        440
      ],
      "parameters": {
        "issueKey": "={{ $('Code1').first().json.id }}",
        "operation": "update",
        "updateFields": {
          "assignee": {
            "__rl": true,
            "mode": "id",
            "value": "={{ $('Code2').item.json.accountId }}"
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6fbc53a3-cbd5-4da6-8587-1ef2c100569c",
      "name": "check accountId",
      "type": "n8n-nodes-base.if",
      "position": [
        1180,
        220
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "d717f6a8-6736-44e5-a131-ee77ffeb4c83",
              "operator": {
                "type": "string",
                "operation": "notEquals"
              },
              "leftValue": "={{ $json.accountId }}",
              "rightValue": "\uff1c\u30a2\u30ab\u30a6\u30f3\u30c8ID\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff1e"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "18548988-495d-4c5f-8dd0-c245881ce995",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        360,
        100
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "228b44b3-ba50-475a-9df0-13f335834bb5",
      "name": "Code1",
      "type": "n8n-nodes-base.code",
      "position": [
        560,
        220
      ],
      "parameters": {
        "jsCode": "return {\n  'id': $input.first().json.id,\n  'summary': $input.first().json.fields.summary,\n  'description': $input.first().json.fields.description,\n}"
      },
      "executeOnce": true,
      "typeVersion": 2
    },
    {
      "id": "f3b79caf-f65d-459e-8e1b-bd9dc16dc17b",
      "name": "Code2",
      "type": "n8n-nodes-base.code",
      "position": [
        980,
        220
      ],
      "parameters": {
        "jsCode": "let comments = '';\nlet accountId = '';\nfor (const item of $input.all()) {\n  comments += '## ' + item.json.updated\n  comments += '\\n'\n  comments += item.json.body.content[0].content[0].text\n  comments += '\\n'\n  comments += '\\n'\n\n  accountId = item.json.updateAuthor.accountId\n}\n\nreturn {\n  'comments': comments,\n  'accountId': accountId\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "3d03736b-5ec9-465c-b5de-1a58b7470b9a",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -40,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "18113aa5-3964-4870-bcdd-173659825115",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -120,
        -140
      ],
      "parameters": {
        "height": 820,
        "content": "## Step1 \nScheduled Execution"
      },
      "typeVersion": 1
    },
    {
      "id": "409f405e-6e9e-4498-993b-a4d63db96720",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        140,
        -140
      ],
      "parameters": {
        "color": 4,
        "width": 1240,
        "height": 820,
        "content": "## Step2\nJira Trigger (Issue Assigned)"
      },
      "typeVersion": 1
    },
    {
      "id": "ff7675e6-5afb-4117-86ff-64e005558b06",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1400,
        -140
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 820,
        "content": "## Step3\nAI Assistant"
      },
      "typeVersion": 1
    },
    {
      "id": "f31aaf67-fa23-45b8-8f52-af3738dd3f52",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1920,
        -140
      ],
      "parameters": {
        "color": 6,
        "width": 500,
        "height": 820,
        "content": "## Step4\nResponse Generation / Ticket Update"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "72ac3c2c-4590-4f79-adad-946aeca43540",
  "connections": {
    "Code1": {
      "main": [
        [
          {
            "node": "Jira Issue Detail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "check accountId",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Jira Add Comment",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Jira Assign": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Jira Issue List": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "check accountId": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Jira Add Comment": {
      "main": [
        [
          {
            "node": "Jira Assign",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Jira Issue List",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Jira Issue Detail": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}