{
  "nodes": [
    {
      "id": "aac771be-d274-4ede-93ef-412767b3ee7a",
      "name": "When clicking \u2018Test workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1100,
        400
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b38b29ce-860c-4b2c-a8e9-2785aee2dbbb",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        420,
        300
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "2327ba0f-e22f-4a1f-92a7-711ff9a547f2",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        0,
        20
      ],
      "parameters": {
        "options": {},
        "fieldsToAggregate": {
          "fieldToAggregate": [
            {
              "fieldToAggregate": "output"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0704872b-8cb4-4054-b758-a520eb631059",
      "name": "Merge5",
      "type": "n8n-nodes-base.merge",
      "position": [
        440,
        680
      ],
      "parameters": {
        "mode": "combine",
        "options": {},
        "combineBy": "combineAll"
      },
      "typeVersion": 3.1
    },
    {
      "id": "a10e25fe-da51-4883-bf9b-a756343b4f81",
      "name": "Get All Tickets Today",
      "type": "n8n-nodes-base.jira",
      "position": [
        -600,
        480
      ],
      "parameters": {
        "limit": 12,
        "options": {
          "jql": "=project = SUP AND created >= startOfDay()"
        },
        "operation": "getAll"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "758029d7-ef63-4c6a-8fb5-df9a0469b21b",
      "name": "Get All Tickets",
      "type": "n8n-nodes-base.jira",
      "position": [
        -700,
        260
      ],
      "parameters": {
        "options": {
          "jql": "=project = {{ $json['Project Key'] }} AND created >= startOfDay()"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d0aa22aa-35a1-4825-b92c-3f0d12fa8e33",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -480,
        260
      ],
      "parameters": {
        "include": "selectedOtherFields",
        "options": {},
        "fieldToSplitOut": "key",
        "fieldsToInclude": "fields.description, fields.summary"
      },
      "typeVersion": 1
    },
    {
      "id": "f665fb25-944c-4e2b-a201-fa2ec43317a7",
      "name": "Loop Tickets",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -220,
        120
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "abbfeb78-c5ad-4192-a372-8686df79a479",
      "name": "Ticket Summarizer",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        660,
        300
      ],
      "parameters": {
        "text": "=Ticket Title:\n{{ $json['fields.summary'] }}\n\nTicket Description:\n{{ $json['fields.description'] }}\n\nTicket Comments:\n{{ JSON.stringify($json.body.content) }}\n\nSummarize all the ticket information, the comments, also the solution found\n\nOutput using this json format:\n{\n  \"Ticket Summary\": \"Write a professional and concise summary that combines all relevant tickets into a single narrative. Include the core issue reported in each ticket, key findings from the comments or conversations (such as user feedback, internal investigation, and developer notes), and the progress or troubleshooting steps taken. Ensure the summary reads fluently like a report, highlights patterns across tickets if any, and avoids repeating ticket IDs unless necessary. Use clear language for stakeholders who may not be technical.\",\n  \"Proposed Solution\": \"Step-by-step explanation or resolution applied.\"\n}",
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.6
    },
    {
      "id": "3b47508e-37fe-46c2-968a-c51fd4dc0fae",
      "name": "Get Comments from Ticket",
      "type": "n8n-nodes-base.jira",
      "position": [
        -100,
        520
      ],
      "parameters": {
        "options": {},
        "issueKey": "={{ $json.key }}",
        "resource": "issueComment",
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "a7706ca1-36eb-42a3-8017-13da6cc7bd90",
      "name": "Set Output",
      "type": "n8n-nodes-base.set",
      "position": [
        840,
        760
      ],
      "parameters": {
        "mode": "raw",
        "options": {},
        "jsonOutput": "={\n  \"output\": {\n    \"Ticket Summary\": {{ JSON.stringify($json.output['Ticket Summary']) }},\n    \"Proposed Solution\": {{ JSON.stringify($json.output['Proposed Solution']) }},\n    \"Key\": {{ JSON.stringify($json.key) }},\n    \"Title\": {{ JSON.stringify($json['fields.summary']) }},\n    \"Description\": {{ JSON.stringify($json['fields.description']) }}\n  }\n}"
      },
      "typeVersion": 3.4
    },
    {
      "id": "effe713c-a706-42df-a090-4ec561571aed",
      "name": "Format Body",
      "type": "n8n-nodes-base.code",
      "position": [
        220,
        20
      ],
      "parameters": {
        "jsCode": "const tickets = $json.output;\nconst formatted = tickets.map(ticket => {\n  return `Key: ${ticket.Key}\nTitle: ${ticket.Title}\nDescription: ${ticket.Description}\nSummaries: ${ticket[\"Ticket Summary\"]}\nSolution: ${ticket[\"Proposed Solution\"]}\nTicket Link: https://nodemationhub.atlassian.YOUR_AWS_SECRET_KEY_HERE/custom/1/${ticket.Key}\\n`;\n}).join('\\n');\n\nreturn [\n  {\n    json: {\n      formattedOutput: formatted\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1474c7dc-acf4-4cd4-a770-4d3fa597ec02",
      "name": "Send Ticket Summaries",
      "type": "n8n-nodes-base.gmail",
      "position": [
        440,
        20
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "={{ $json.formattedOutput }}",
        "options": {
          "appendAttribution": false
        },
        "subject": "=Daily Ticket Summaries \u2013 {{ $now.format('dd MMM yyyy') }}",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "0af73efa-e3ed-4b48-aa30-d54486fc7861",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        740,
        540
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5",
          "cachedResultName": "gpt-5"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "68a48d49-276a-430a-b918-e161350d7676",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        960,
        520
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"Ticket Summary\": \"Write a professional and concise summary that combines all relevant tickets into a single narrative. Include the core issue reported in each ticket, key findings from the comments or conversations (such as user feedback, internal investigation, and developer notes), and the progress or troubleshooting steps taken. Ensure the summary reads fluently like a report, highlights patterns across tickets if any, and avoids repeating ticket IDs unless necessary. Use clear language for stakeholders who may not be technical.\",\n  \"Proposed Solution\": \"Step-by-step explanation or resolution applied.\"\n}"
      },
      "typeVersion": 1.2
    },
    {
      "id": "13de2032-fdf3-421b-9b15-c1a91e23cc42",
      "name": "Set Project Key",
      "type": "n8n-nodes-base.set",
      "position": [
        -880,
        260
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f9c91322-0594-46f1-af00-21bd6b7f93a5",
              "name": "Project Key",
              "type": "string",
              "value": "SUP"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "d5edcb5b-916b-498e-a1b9-edb008d05ca6",
      "name": "Get All Tickets Without Filter",
      "type": "n8n-nodes-base.jira",
      "position": [
        -820,
        480
      ],
      "parameters": {
        "limit": 2,
        "options": {
          "jql": "=project = {{ $json[\"Project Key\"] }}"
        },
        "operation": "getAll"
      },
      "credentials": {
        "jiraSoftwareCloudApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3c440031-3e61-4f63-b6d5-74679081a06b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1180,
        -620
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 360,
        "content": "## \ud83c\udfab Daily Jira Ticket Summarizer using GPT-5 and Jira API\n\nWhat This Template Does:\n\n- Automatically fetches Jira tickets from a specified project (SUP) created today\n- Retrieves detailed ticket information including title, description, and all comments\n- Uses OpenAI's GPT-5 model to intelligently analyze and summarize each ticket\n- Generates professional summaries that combine ticket details, comments, and proposed solutions\n- Compiles all ticket summaries into a formatted daily report\n- Sends the comprehensive report via Gmail with ticket links for easy access\n- Processes tickets individually through batch processing to ensure accurate AI analysis"
      },
      "typeVersion": 1
    },
    {
      "id": "2cfb5098-77bf-4ba6-8a6d-d166a6ae12b5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1180,
        -240
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 300,
        "content": "## SETUP REQUIRED\n\nWorkflow Configurations:\n- Adjust the JQL query filters in Jira nodes based on your requirements\n- Configure the email recipient in \"Send Ticket Summaries\" node\n- Modify the AI prompt in \"Ticket Summarizer\" node to match your reporting needs\n\nRequired Credentials:\n- Jira Software Cloud API Credential\n- Gmail OAuth2 Credential  \n- OpenAI API Key"
      },
      "typeVersion": 1
    },
    {
      "id": "90ba0d1a-47e9-4807-ae45-3367c79f15e8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -520,
        -620
      ],
      "parameters": {
        "color": 4,
        "width": 640,
        "height": 460,
        "content": "## \ud83d\udccb WORKFLOW PROCESS OVERVIEW\n\nStep 1: \ud83d\ude80 Manual Trigger / Schedule Trigger initiates the workflow\nStep 2: \u2699\ufe0f Set Project Key defines the Jira project identifier for ticket filtering\nStep 3: \ud83c\udfab Get All Tickets from the specified project created today\nStep 4: \ud83d\udce4 Split Out extracts individual ticket data including key, summary, and description\nStep 5: \ud83d\udd04 Loop Tickets processes each ticket individually through batch splitting mechanism\nStep 6: \ud83d\udcac Get Comments from Ticket retrieves all comments and conversations for each ticket\nStep 7: \ud83d\udd17 Merge combines ticket data with its associated comments for complete context\nStep 8: \ud83e\udd16 Ticket Summarizer (AI Agent) analyzes ticket information using OpenAI GPT-5 to generate:\n - Professional ticket summary combining all relevant information\n - Proposed solution with step-by-step explanations\nStep 9: \ud83d\udcca Set Output structures the AI analysis into standardized JSON format\nStep 10: \ud83d\udcc8 Aggregate collects all processed ticket summaries into a single dataset\nStep 11: \ud83d\udcdd Format Body creates a readable email format with ticket links to Jira\nStep 12: \ud83d\udce7 Send Ticket Summaries delivers the daily report via Gmail with subject \"Daily Ticket Summaries \u2013 [Date]\""
      },
      "typeVersion": 1
    },
    {
      "id": "59006434-fa20-467c-b405-30ea1ec7197c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        -920
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 760,
        "content": "# \ud83d\udc4b Hi, I\u2019m Billy\n\nI help businesses build **n8n workflows** & **AI automation projects**.  \nNeed help with n8n or AI Automation projects? \nContact me and let\u2019s build your automation together.\n\n\ud83d\udce9 **Email:** billychartanto@gmail.com  \n\ud83e\udd1d **n8n Creator:** [n8n.io/creators/billy](https://n8n.io/creators/billy/)\n\ud83c\udf10 **My n8n Projects:** [billychristi.com/n8n](https://www.billychristi.com/n8n)  \n\n\n\n---\n\ud83d\udca1 Feel free to get in touch if you\u2019d like help on your next automation project or if you have any feedback or thoughts to share.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c3c26cc1-1187-49be-8f5e-c6aa6fd355ce",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -740,
        160
      ],
      "parameters": {
        "color": 4,
        "width": 220,
        "height": 280,
        "content": "Configuration:\nUpdate the Jira credentials with yours."
      },
      "typeVersion": 1
    },
    {
      "id": "86acccd2-f4c5-445a-b1c6-82a8e88ca73a",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 380,
        "height": 380,
        "content": "## Gmail - Send Notification\nYou can adjust the subject & body of the notification here.\nAlso, update the recipient email."
      },
      "typeVersion": 1
    },
    {
      "id": "c83cb8a2-9a61-4195-8167-503287b8787e",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1100,
        120
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Ticket Summarizer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge5": {
      "main": [
        [
          {
            "node": "Set Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Format Body",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Loop Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Output": {
      "main": [
        [
          {
            "node": "Loop Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Body": {
      "main": [
        [
          {
            "node": "Send Ticket Summaries",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Tickets": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Comments from Ticket",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          },
          {
            "node": "Merge5",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get All Tickets": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Project Key": {
      "main": [
        [
          {
            "node": "Get All Tickets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Project Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Ticket Summarizer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Ticket Summarizer": {
      "main": [
        [
          {
            "node": "Merge5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Comments from Ticket": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Ticket Summarizer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Set Project Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}