{
  "id": "dHRAjDXcWFTXBegw",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI-Powered Jira Ticket Triage & Auto-Resolution",
  "tags": [],
  "nodes": [
    {
      "id": "19750f2f-3fdd-46c0-b4aa-f870fa00f690",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1968,
        784
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "49094646-2caa-4eed-8717-9a2d1179688f",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1408,
        1184
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "6e7f32e9-28f4-43dd-ab09-37f1ecbcc125",
      "name": "OpenAI Chat Model3",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -224,
        512
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "52b3f3b6-53fc-4ac2-bd3c-fdc60de5d4e7",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1376,
        544
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "2f3d097b-35b6-44a4-9b39-dd5e53184b85",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -3728,
        592
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "be3be563-355e-43c9-9617-22199612f7ae",
      "name": "Get Issue Comments",
      "type": "n8n-nodes-base.jira",
      "position": [
        -2704,
        592
      ],
      "parameters": {
        "options": {},
        "issueKey": "={{ $json.key }}",
        "resource": "issueComment",
        "operation": "getAll"
      },
      "typeVersion": 1
    },
    {
      "id": "ed5ec967-65bc-44b2-bf3d-6ee51a2afe75",
      "name": "Close Issue",
      "type": "n8n-nodes-base.jira",
      "position": [
        -784,
        16
      ],
      "parameters": {
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "operation": "update",
        "updateFields": {
          "statusId": {
            "__rl": true,
            "mode": "list",
            "value": "31",
            "cachedResultName": "Done"
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "b93292f4-e415-4042-a155-850cda8fcc9c",
      "name": "Send Reminder",
      "type": "n8n-nodes-base.jira",
      "position": [
        112,
        368
      ],
      "parameters": {
        "comment": "={{ $json.text }}\n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "typeVersion": 1
    },
    {
      "id": "f716147d-3c26-4b80-9a43-5bf018c319e0",
      "name": "Join Comments",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        -2528,
        592
      ],
      "parameters": {
        "options": {},
        "aggregate": "aggregateAllItemData"
      },
      "typeVersion": 1
    },
    {
      "id": "b12356eb-7cd3-497d-bfc4-d6d920a6c3ac",
      "name": "Add Autoclose Message",
      "type": "n8n-nodes-base.jira",
      "position": [
        -992,
        208
      ],
      "parameters": {
        "comment": "=Autoclosing due to inactivity. Please create a new ticket if you require additional support. Thank you!\n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "typeVersion": 1
    },
    {
      "id": "e2299f7a-5be6-451d-bddf-ea298a39e310",
      "name": "Ask For Feedback Message",
      "type": "n8n-nodes-base.jira",
      "position": [
        -992,
        16
      ],
      "parameters": {
        "comment": "=[~accountid:{{ $('Get Issue Metadata').item.json.reporter_accountId }}]\n\nWe think the issue is resolved so we're autoclosing it. If you've been satisified with our service, please leave us a 5 start review here: [link](link/to/review_site)\n\nPlease feel free to create another ticket if you need further assistance.\n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "typeVersion": 1
    },
    {
      "id": "dc31d0a6-5f5b-4b11-8c26-61db9e358d2c",
      "name": "Simplify Thread For AI",
      "type": "n8n-nodes-base.set",
      "position": [
        -2336,
        592
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f65c5971-c90d-47f2-823f-37fd03d8e9c7",
              "name": "thread",
              "type": "array",
              "value": "={{\n$json.data.map(comment => {\n const { accountId, displayName } = comment.author;\n\n const message = comment.body.content.map(item =>\n `<${item.type}>${item.content\n .filter(c => c.text || c.content)\n .map(c => c.content\n ? c.content\n .filter(cc => c.text || c.content)\n .map(cc => cc.text)\n .join(' ')\n : c.text\n )}</${item.type}>`\n ).join('');\n return `${displayName} (accountId: ${accountId}) says: ${message}`;\n})\n\n}}"
            },
            {
              "id": "7b98b2db-3417-472f-bea2-a7aebe30184c",
              "name": "topic",
              "type": "string",
              "value": "={{\n[\n `title: ${$('Get Issue Metadata').item.json.title}`,\n `original message: ${$('Get Issue Metadata').item.json.description.replaceAll(/\\n/g, ' ')}`,\n `reported by: ${$('Get Issue Metadata').item.json.reporter}`\n].join('\\n')\n}}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "c3663049-f390-4d91-a988-97a72b804e05",
      "name": "Solution Found?",
      "type": "n8n-nodes-base.if",
      "position": [
        -1008,
        992
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "0e71783b-3072-421a-852c-58940d0dd7cd",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ $json.output.solution_found }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "49c2a658-67a5-4a4c-a0ae-31d9f2edd9d1",
      "name": "Reply to Issue",
      "type": "n8n-nodes-base.jira",
      "position": [
        -688,
        992
      ],
      "parameters": {
        "comment": "=Hey there!\n{{ $('KnowledgeBase Agent').item.json.output.response }}\nWe'll close this issue now but feel free to create a new one if needed.\n(this is an automated message)",
        "options": {},
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "resource": "issueComment"
      },
      "typeVersion": 1
    },
    {
      "id": "9c0975dc-ecad-4226-8c7b-255e81755200",
      "name": "Last Message is Not Bot",
      "type": "n8n-nodes-base.if",
      "position": [
        -400,
        368
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6e07d5dc-01b2-4735-8fc1-983fc57dfaaf",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              },
              "leftValue": "={{ !$('Simplify Thread For AI').item.json.thread.last().includes('this is an automated message') }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "9a6b6ebf-084d-4066-aa21-d028fae7bc13",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1056,
        1184
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"solution_found\": {\n\t\t\t\"type\": \"boolean\"\n\t\t},\n \"short_summary_of_issue\": {\n \"type\": \"string\"\n },\n\t\t\"response\": {\n\t\t\t\"type\": \"string\"\n\t\t}\n\t}\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "04ce20c1-37d3-4222-bd70-206783abc6c2",
      "name": "Get Issue Metadata",
      "type": "n8n-nodes-base.set",
      "position": [
        -2880,
        592
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "200706ea-6936-48ae-a46c-38d6e2eff558",
              "name": "key",
              "type": "string",
              "value": "={{ $json.key }}"
            },
            {
              "id": "3e3584bf-dc5c-408a-896c-1660710860f6",
              "name": "title",
              "type": "string",
              "value": "={{ $json.fields.summary }}"
            },
            {
              "id": "e1d89014-5e07-4752-9e7c-ae8d4cba6f6e",
              "name": "url",
              "type": "string",
              "value": "={{\n[\n 'https:/',\n $json.self.extractDomain(),\n 'browse',\n $json.key\n ].join('/')\n}}"
            },
            {
              "id": "df1cca88-1c57-475d-968e-999f6c25dba7",
              "name": "date",
              "type": "string",
              "value": "={{ DateTime.fromISO($json.fields.created).format('yyyy-MM-dd') }}"
            },
            {
              "id": "7fc9c625-e741-43bb-9223-b8024fc86cc7",
              "name": "reporter",
              "type": "string",
              "value": "={{ $json.fields.reporter.displayName }}"
            },
            {
              "id": "17bf06ae-fcad-4eb3-add8-11ac85e9a68e",
              "name": "reporter_url",
              "type": "string",
              "value": "={{\n[\n 'https:/',\n $json.fields.reporter.self.extractDomain(),\n 'jira',\n 'people',\n $json.fields.reporter.accountId\n ].join('/')\n}}"
            },
            {
              "id": "7624642f-f76b-41ec-b402-280b64d46400",
              "name": "reporter_accountId",
              "type": "string",
              "value": "={{ $json.fields.reporter.accountId }}"
            },
            {
              "id": "0fa1d73f-4e8b-435b-a78d-37e95c85c87c",
              "name": "description",
              "type": "string",
              "value": "={{ $json.fields.description }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "62cdb4fb-bc69-4518-9055-2cdae86758da",
      "name": "Notify Slack Channel",
      "type": "n8n-nodes-base.slack",
      "position": [
        -848,
        1152
      ],
      "parameters": {
        "select": "channel",
        "blocksUi": "={{\n{\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Hey there \ud83d\udc4b\\nI found a zombie ticket that no one has taken a look at yet.\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": `*[${$('Get Issue Metadata').item.json.key}] ${$('Get Issue Metadata').item.json.title}*\\n${$('KnowledgeBase Agent').item.json.output.short_summary_of_issue}\\n\ud83d\udc64 <${$('Get Issue Metadata').item.json.reporter_url}|${$('Get Issue Metadata').item.json.reporter}> \ud83d\udcc5 ${$('Get Issue Metadata').item.json.date} \ud83d\udd17 <${$('Get Issue Metadata').item.json.url}|Link to Issue>\\n`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"I couldn't find an answer in the knowledgebase so I've notified the user and closed the ticket. Thanks!\"\n\t\t\t}\n\t\t}\n\t]\n}\n}}",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C07S0NQ04D7",
          "cachedResultName": "n8n-jira"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "dccced86-8f6b-40f0-9ebe-a02611cd2a63",
      "name": "Close Issue2",
      "type": "n8n-nodes-base.jira",
      "position": [
        -528,
        992
      ],
      "parameters": {
        "issueKey": "={{ $('Get Issue Metadata').item.json.key }}",
        "operation": "update",
        "updateFields": {
          "statusId": {
            "__rl": true,
            "mode": "list",
            "value": "31",
            "cachedResultName": "Done"
          }
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a2625778-9277-4755-bb8e-f36a96b4cf14",
      "name": "Get List of Unresolved Long Lived Issues",
      "type": "n8n-nodes-base.jira",
      "position": [
        -3520,
        592
      ],
      "parameters": {
        "limit": 10,
        "options": {
          "jql": "status IN (\"To Do\", \"In Progress\") AND created <= -7d"
        },
        "operation": "getAll"
      },
      "typeVersion": 1
    },
    {
      "id": "505812dc-157c-4087-848d-7bb4eca52f13",
      "name": "Execute Workflow",
      "type": "n8n-nodes-base.executeWorkflow",
      "position": [
        -3328,
        592
      ],
      "parameters": {
        "mode": "each",
        "options": {},
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $workflow.id }}"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7f8279ab-f23e-4853-b8fd-041d578faa6c",
      "name": "Execute Workflow Trigger",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -3056,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "31ce11ac-4f3e-4444-80d8-772e6f77ba57",
      "name": "Customer Satisfaction Agent",
      "type": "@n8n/n8n-nodes-langchain.sentimentAnalysis",
      "position": [
        -1408,
        288
      ],
      "parameters": {
        "options": {},
        "inputText": "=issue:\n{{ $('Simplify Thread For AI').item.json.topic }}\n\ncomments:\n{{ $('Simplify Thread For AI').item.json.thread.join('\\n') }}"
      },
      "typeVersion": 1
    },
    {
      "id": "9b947397-eb53-4a22-a7a9-5802fddf2f3b",
      "name": "KnowledgeBase Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1392,
        992
      ],
      "parameters": {
        "text": "=issue:\n{{ $('Simplify Thread For AI').item.json.topic }}\n\ncomments:\n{{ $('Simplify Thread For AI').item.json.thread.join('\\n') }}",
        "options": {
          "systemMessage": "Help the user answer their question using the company's knowledgebase. Your answer must be based factually on documents retrieved from the knowledge. If no relevant information is found or the information is insufficent to answer the user's query, you must tell the user so and not mislead the user. If you don't know the answer, it is okay to say you don't know."
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "ad4b347a-15d5-42d8-96cf-c7dbe4debf2f",
      "name": "Issue Reminder Agent",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -224,
        368
      ],
      "parameters": {
        "text": "=issue:\n{{ $('Simplify Thread For AI').item.json.topic }}\n\ncomments:\n{{ $('Simplify Thread For AI').item.json.thread }}",
        "messages": {
          "messageValues": [
            {
              "message": "=The user has a pending issue and some time has passed since the last update. Analyse the last message in this thread and generate a short reminder message to add to the issue comments which summarizes and reiterates what pending action or information is required. Return only the message."
            }
          ]
        },
        "promptType": "define"
      },
      "typeVersion": 1.4
    },
    {
      "id": "d7266fed-9760-4d5d-adb7-e7c3833565bb",
      "name": "Find Simlar Issues",
      "type": "n8n-nodes-base.jiraTool",
      "position": [
        -1296,
        1184
      ],
      "parameters": {
        "limit": 4,
        "options": {
          "jql": "=text ~ \"{{ $fromAI('title', 'the title of the current issue', 'string', '') }}\" AND status IN (\"In Progress\", \"Done\")"
        },
        "operation": "getAll",
        "descriptionType": "manual",
        "toolDescription": "Call this tool to search for similar issues in JIRA."
      },
      "typeVersion": 1
    },
    {
      "id": "53bcb8ef-7e70-4fe0-b864-bfa068937da5",
      "name": "Query KnowledgeBase",
      "type": "n8n-nodes-base.notionTool",
      "position": [
        -1168,
        1184
      ],
      "parameters": {
        "text": "={{ $fromAI('search_terms', 'relevant terms to search for information on the current issue', 'string', '') }}",
        "limit": 4,
        "options": {},
        "operation": "search",
        "descriptionType": "manual",
        "toolDescription": "Search the knowledgebase for information relevant to the issue."
      },
      "typeVersion": 2.2
    },
    {
      "id": "7ed6b7fa-a500-42f7-94d0-33c230c0d297",
      "name": "Report Unhappy Resolution",
      "type": "n8n-nodes-base.slack",
      "position": [
        -784,
        368
      ],
      "parameters": {
        "text": "=",
        "select": "channel",
        "blocksUi": "={{\n{\n\t\"blocks\": [\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Hey there \ud83d\udc4b\\nI found a unclosed ticket which was resolved but thread overall has a negative sentiment score. Please address or close the ticket.\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": `*[${$('Get Issue Metadata').item.json.key}] ${$('Get Issue Metadata').item.json.title}*\\n${$('KnowledgeBase Agent').item.json.output.short_summary_of_issue}\\n\ud83d\udc64 <${$('Get Issue Metadata').item.json.reporter_url}|${$('Get Issue Metadata').item.json.reporter}> \ud83d\udcc5 ${$('Get Issue Metadata').item.json.date} \ud83d\udd17 <${$('Get Issue Metadata').item.json.url}|Link to Issue>\\n`\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"type\": \"divider\"\n\t\t},\n\t\t{\n\t\t\t\"type\": \"section\",\n\t\t\t\"text\": {\n\t\t\t\t\"type\": \"mrkdwn\",\n\t\t\t\t\"text\": \"Thanks!\"\n\t\t\t}\n\t\t}\n\t]\n}\n}}",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": "C07S0NQ04D7",
          "cachedResultName": "n8n-jira"
        },
        "messageType": "block",
        "otherOptions": {}
      },
      "typeVersion": 2.2
    },
    {
      "id": "3a42f924-98b8-4e3f-8b25-6dd57ba531c7",
      "name": "Classify Current Issue State",
      "type": "@n8n/n8n-nodes-langchain.textClassifier",
      "position": [
        -1968,
        624
      ],
      "parameters": {
        "options": {},
        "inputText": "=issue:\n{{ $('Simplify Thread For AI').item.json.topic }}\n\ncomments:\n{{ $('Simplify Thread For AI').item.json.thread.join('\\n') || 'There are no comments' }}",
        "categories": {
          "categories": [
            {
              "category": "resolved",
              "description": "There are human comments and a resolution was found and/or accepted"
            },
            {
              "category": "pending more information",
              "description": "There are human comments but no resolution has been reached yet"
            },
            {
              "category": "still waiting",
              "description": "Reporter is still waiting on a response. Ignoring automated messages, there are no comments."
            }
          ]
        }
      },
      "executeOnce": false,
      "typeVersion": 1
    },
    {
      "id": "9f80aa23-65a8-461e-9180-294344473c74",
      "name": "Main Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4512,
        176
      ],
      "parameters": {
        "color": 7,
        "width": 580,
        "height": 1844,
        "content": "## \ud83c\udfab Jira Zombie Ticket Auto-Resolver\n\nRuns on a schedule to find Jira issues that have sat untouched for 7+ days, then automatically classifies each one's state and takes the right next action \u2014 closing resolved issues, nudging stalled ones with a reminder, or trying to solve unanswered ones from your knowledge base.\n\n**Perfect for:** Support/IT teams running Jira Service Management who want stale tickets triaged automatically instead of piling up in the backlog.\n\n---\n\n## How it works\n\n1. **Schedule Trigger** \u2014 Kicks off the workflow on a recurring interval.\n2. **Get List of Unresolved Long Lived Issues** \u2014 Queries Jira for issues in \"To Do\" or \"In Progress\" created 7+ days ago.\n3. **Execute Workflow** \u2014 Runs the rest of the logic once per issue found, calling this same workflow recursively.\n4. **Execute Workflow Trigger** \u2014 Entry point for each individual issue run.\n5. **Get Issue Metadata** \u2014 Pulls the issue's key, title, URL, date, reporter, and description into a clean object.\n6. **Get Issue Comments** \u2014 Fetches every comment on the issue from Jira.\n7. **Join Comments** \u2014 Aggregates all comment items into a single array.\n8. **Simplify Thread For AI** \u2014 Flattens the comment thread and issue metadata into plain text the AI models can read.\n9. **Classify Current Issue State** \u2014 AI classifier (OpenAI Chat Model) sorts the issue into \"resolved,\" \"pending more information,\" or \"still waiting.\"\n10. **Customer Satisfaction Agent** *(resolved path)* \u2014 AI sentiment analysis (OpenAI Chat Model4) judges whether the thread ended on a positive, neutral, or negative note.\n11. **Ask For Feedback Message** \u2014 Posts a thank-you/review-request comment for positively resolved issues, then closes them.\n12. **Add Autoclose Message** \u2014 Posts a neutral autoclose comment for neutrally resolved issues, then closes them.\n13. **Report Unhappy Resolution** \u2014 Alerts the Slack channel when a \"resolved\" issue actually has a negative sentiment score, without closing it.\n14. **Close Issue** \u2014 Marks the issue as Done after a feedback or autoclose message is posted.\n15. **Last Message is Not Bot** *(still waiting path)* \u2014 Checks the last comment isn't itself an automated message before nagging again.\n16. **Issue Reminder Agent** \u2014 AI (OpenAI Chat Model3) writes a short reminder summarizing what's still pending.\n17. **Send Reminder** \u2014 Posts that reminder as a new comment on the issue.\n18. **KnowledgeBase Agent** *(pending information path)* \u2014 AI agent (OpenAI Chat Model1) searches for an answer using the **Find Simlar Issues** and **Query KnowledgeBase** tools, returning structured output via the **Structured Output Parser**.\n19. **Solution Found?** \u2014 Branches on whether the agent found a usable answer.\n20. **Reply to Issue** \u2014 Posts the AI's answer as a comment when a solution is found.\n21. **Notify Slack Channel** *(optional path)* \u2014 Alerts the team in Slack when no knowledgebase answer was found; the ticket still gets closed.\n22. **Close Issue2** \u2014 Marks the issue as Done after the KB reply (or Slack notification) is posted.\n\n---\n\n## Setup (~15 min)\n\n1. **Jira Software Cloud** \u2014 Connect your credentials in every Jira node (*Get List of Unresolved Long Lived Issues*, *Get Issue Metadata*, *Get Issue Comments*, *Close Issue*, *Close Issue2*, *Send Reminder*, *Reply to Issue*, *Ask For Feedback Message*, *Add Autoclose Message*, *Find Simlar Issues*).\n2. **OpenAI API** \u2014 Add your API key in all four model nodes (*OpenAI Chat Model*, *OpenAI Chat Model1*, *OpenAI Chat Model3*, *OpenAI Chat Model4*).\n3. **Notion** \u2014 Connect your credentials in *Query KnowledgeBase* and confirm it points at your support knowledgebase.\n4. **Slack** \u2014 Connect your credentials in *Notify Slack Channel* and *Report Unhappy Resolution*, and set the target channel.\n5. **JQL filter** \u2014 Adjust the `created <= -7d` and status filter in *Get List of Unresolved Long Lived Issues* to match your team's SLA.\n6. **Status ID** \u2014 Confirm the \"Done\" status ID (`31`) in *Close Issue* and *Close Issue2* matches your Jira workflow.\n> This workflow closes tickets automatically. Test it on a non-production project first, and update the placeholder review link in *Ask For Feedback Message* before publishing."
      },
      "typeVersion": 1
    },
    {
      "id": "44c4b223-67c6-4759-a9f9-8910c759d3bf",
      "name": "Section 1 - Trigger & Intake",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3824,
        432
      ],
      "parameters": {
        "color": 5,
        "width": 2304,
        "height": 560,
        "content": "## 1\ufe0f\u20e3 Trigger & Intake\n\nThe **Schedule Trigger** kicks off a periodic scan, and **Get List of Unresolved Long Lived Issues** pulls every Jira ticket that's been open 7+ days. **Execute Workflow** loops through them one at a time via **Execute Workflow Trigger**, and **Get Issue Metadata**, **Get Issue Comments**, and **Join Comments** collect the issue's details and full comment history. **Simplify Thread For AI** flattens it all into plain text, which **Classify Current Issue State** then sorts into resolved, pending information, or still waiting."
      },
      "typeVersion": 1
    },
    {
      "id": "81c80944-16f4-40fd-a154-9435aacacb9a",
      "name": "Section 2 - Resolved Ticket Handling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1488,
        -192
      ],
      "parameters": {
        "color": 3,
        "width": 960,
        "height": 888,
        "content": "## 2\ufe0f\u20e3 Resolved Ticket Handling\n\nWhen a ticket is classified as resolved, the **Customer Satisfaction Agent** scores the sentiment of the closing exchange. A positive result triggers **Ask For Feedback Message**, a neutral one triggers **Add Autoclose Message**, and both paths finish at **Close Issue**. If the sentiment comes back negative despite being marked resolved, **Report Unhappy Resolution** flags it to Slack instead of closing it automatically."
      },
      "typeVersion": 1
    },
    {
      "id": "62017ad3-ef65-4b03-ab75-676a67c26916",
      "name": "Section 3 - Stalled Ticket Reminders",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -496,
        208
      ],
      "parameters": {
        "color": 6,
        "width": 860,
        "height": 500,
        "content": "## 3\ufe0f\u20e3 Stalled Ticket Reminders\n\nFor tickets still waiting on a response, **Last Message is Not Bot** confirms the thread hasn't already been nudged automatically. The **Issue Reminder Agent** then writes a short, context-aware reminder summarizing what's pending, and **Send Reminder** posts it back to the issue as a comment."
      },
      "typeVersion": 1
    },
    {
      "id": "9f2a6d48-721b-435c-a081-c52df5f27086",
      "name": "Section 4 - Knowledge Base Resolution",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1504,
        816
      ],
      "parameters": {
        "color": 4,
        "width": 1240,
        "height": 576,
        "content": "## 4\ufe0f\u20e3 Knowledge Base Resolution\n\nFor tickets pending more information, the **KnowledgeBase Agent** searches for an answer using the **Find Simlar Issues** and **Query KnowledgeBase** tools, returning a structured result via the **Structured Output Parser**. **Solution Found?** branches the outcome: a match triggers **Reply to Issue** and **Close Issue2**, while no match routes through **Notify Slack Channel** before still closing the ticket."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "executionOrder": "v1"
  },
  "versionId": "1aafa650-48de-4102-b697-19fa3a74ad61",
  "nodeGroups": [],
  "connections": {
    "Join Comments": {
      "main": [
        [
          {
            "node": "Simplify Thread For AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Reply to Issue": {
      "main": [
        [
          {
            "node": "Close Issue2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Solution Found?": {
      "main": [
        [
          {
            "node": "Reply to Issue",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Notify Slack Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get List of Unresolved Long Lived Issues",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Classify Current Issue State",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Find Simlar Issues": {
      "ai_tool": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Issue Comments": {
      "main": [
        [
          {
            "node": "Join Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Issue Metadata": {
      "main": [
        [
          {
            "node": "Get Issue Comments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model3": {
      "ai_languageModel": [
        [
          {
            "node": "Issue Reminder Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "Customer Satisfaction Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "KnowledgeBase Agent": {
      "main": [
        [
          {
            "node": "Solution Found?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Query KnowledgeBase": {
      "ai_tool": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Issue Reminder Agent": {
      "main": [
        [
          {
            "node": "Send Reminder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Slack Channel": {
      "main": [
        [
          {
            "node": "Reply to Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add Autoclose Message": {
      "main": [
        [
          {
            "node": "Close Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simplify Thread For AI": {
      "main": [
        [
          {
            "node": "Classify Current Issue State",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Last Message is Not Bot": {
      "main": [
        [
          {
            "node": "Issue Reminder Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask For Feedback Message": {
      "main": [
        [
          {
            "node": "Close Issue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Trigger": {
      "main": [
        [
          {
            "node": "Get Issue Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Customer Satisfaction Agent": {
      "main": [
        [
          {
            "node": "Ask For Feedback Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Add Autoclose Message",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Report Unhappy Resolution",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Current Issue State": {
      "main": [
        [
          {
            "node": "Customer Satisfaction Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Last Message is Not Bot",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "KnowledgeBase Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List of Unresolved Long Lived Issues": {
      "main": [
        [
          {
            "node": "Execute Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}