ChatGPTSoftwareInfra & DevOpsAI score · 74/100AI-assisted edit · no obvious prompt-injection riskn8n.io

Auto-Sync GitHub Issues to Jira: GPT-4o Bug Analysis & Team Alerts

GitHub Webhook → GPT-4o severity & category analysis → Jira ticket creation → parallel Slack/Discord/GitHub notifications

ExperiencedStepsWorkflowPromptTip
Who
Development teams, open-source maintainers, or DevOps engineers who need automated GitHub bug triage
You get
New GitHub issues trigger AI analysis to create Jira tickets with severity, category, reproduction steps, and time estimates, while posting back to GitHub and alerting Slack/Discord
You need
n8n · webhook · code · openai · github · slack

Constraints

Prerequisites: n8n instance; GitHub repo admin access; Jira Software Cloud with API token; OpenAI API key with GPT-4o access; Slack workspace or Discord server (optional). Customization required: developer email mappings, JIRA_PROJECT_KEY, Slack channel name, Discord webhook URL, Jira domain.

What they did

This n8n template demonstrates a complete automation workflow: capture new GitHub issues via webhook, filter only opened events, extract issue context and mentioned files with a Code node, call GPT-4o to analyze bug severity, category, reproduction steps, root cause, priority, complexity, recommended developer, and estimated hours, then parse and map the response to Jira fields via another Code node, create a Jira Bug ticket, and finally execute three parallel branches: GitHub comment backfill, Slack rich message alert, and Discord webhook alert, returning JSON to the GitHub webhook.

How it went

Source author claims: per-issue processing time drops from 20 minutes to 2 minutes (90% faster), 100% analysis consistency, zero missed notifications, and estimated savings of ~$685/month for 50 bugs (author_report, not tested).

Worth knowing

1. Developer email mappings must be customized; template uses [email protected] placeholders. 2. Slack channel name uses dev-alerts (no #); Discord requires full webhook URL. 3. Jira domain, project key, and 'Bug' issue type must match your instance. 4. GPT-4o call costs approximately $0.01-0.03 per issue. 5. If GPT returns non-standard JSON, the parse node has hardcoded fallback values; production use should add logging alerts. 6. Template includes ROI calculations and customization ideas (severity-based routing, multi-repo support, email notifications) as author suggestions, not core flow requirements.

Steps

  1. Configure GitHub Webhook Trigger

    Activate the workflow in n8n and copy the Webhook node URL. Go to GitHub repo Settings → Webhooks → Add webhook, paste the URL, set Content-type to application/json, select Issues events, and save. Test by creating a new issue.

  2. Filter Only New Issues

    Add an IF node with condition action = "opened" (via {{$json.action}}). TRUE continues, FALSE stops. Prevents duplicate Jira tickets from edits, labels, or comments.

  3. Extract Issue Context

    Use a Code node to run JavaScript extracting issue number, title, description, reporter, labels, URL, repo info, and regex-match mentioned code files (.js/.py/.ts/.jsx/.tsx/.java/.go/.rb/.php/.cpp/.c/.css/.html) from the GitHub payload. Output a structured object for downstream nodes. Node code: ```js const issue = $input.item.json.issue; const repo = $input.item.json.repository; const fileRegex = /`([^`]*\.(js|py|ts|jsx|tsx|java|go|rb|php|cpp|c|css|html))`/g; const mentionedFiles = []; let match; if (issue.body) { while ((match = fileRegex.exec(issue.body)) !== null) { mentionedFiles.push(match[1]); } } return { issueNumber: issue.number, title: issue.title, description: issue.body || "No description provided", reporter: issue.user.login, reporterAvatar: issue.user.avatar_url, labels: issue.labels.map(l => l.name).join(", ") || "none", url: issue.html_url, createdAt: issue.created_at, mentionedFiles: mentionedFiles.join(", ") || "No files mentioned", repositoryName: repo.full_name, repositoryOwner: repo.owner.login, repositoryRepo: repo.name }; ```

  4. GPT-4o Bug Analysis

    Use the OpenAI node calling GPT-4o (model: gpt-4o, maxTokens: 1000, temperature: 0.3). Pass the extracted issue title, description, labels, mentioned files, and repository name in the prompt, requiring strict JSON output with severity, category, reproduction steps, root cause, priority, complexity, recommended developer type, and estimated hours.

    Execution prompt · Source text。GPT-4o Bug Analysis node text field

    =Analyze this GitHub issue and provide a structured response in valid JSON format:
    
    **Issue Title:** {{$json.title}}
    **Description:** {{$json.description}}
    **Labels:** {{$json.labels}}
    **Mentioned Files:** {{$json.mentionedFiles}}
    **Repository:** {{$json.repositoryName}}
    
    Provide your analysis in this exact JSON structure:
    {
      "bugSeverity": "Critical|High|Medium|Low",
      "category": "Backend|Frontend|Database|API|UI|Performance|Security|Infrastructure",
      "reproductionSteps": "Clear numbered steps to reproduce",
      "potentialRootCause": "Brief technical analysis",
      "suggestedPriority": "P0|P1|P2|P3",
      "estimatedComplexity": "Simple|Medium|Complex",
      "recommendedDeveloper": "backend-dev|frontend-dev|fullstack-dev|devops",
      "estimatedHours": "number between 1-40"
    }
    
    Respond with ONLY the JSON object, no additional text.
  5. Parse GPT Response & Map Data

    Use a Code node to parse the GPT-4o JSON response (with fallback defaults on parse failure: Medium/General/P2/Medium/fullstack-dev/8h). Map recommendedDeveloper to actual email addresses, convert suggestedPriority to Jira priorities (P0→Highest, P1→High, P2→Medium, P3→Low), and build the jiraLabels array. ⚠️ You must customize developerMapping emails. Node code: ```js const issueData = $('Extract Issue Context').item.json; const gptResponse = $input.item.json.text; let analysis; try { analysis = JSON.parse(gptResponse); } catch (error) { analysis = { bugSeverity: "Medium", category: "General", reproductionSteps: "See original issue", potentialRootCause: "Requires investigation", suggestedPriority: "P2", estimatedComplexity: "Medium", recommendedDeveloper: "fullstack-dev", estimatedHours: 8 }; } const developerMapping = { "backend-dev": "[email protected]", "frontend-dev": "[email protected]", "fullstack-dev": "[email protected]", "devops": "[email protected]" }; const priorityMapping = { "P0": "Highest", "P1": "High", "P2": "Medium", "P3": "Low" }; return { ...issueData, bugSeverity: analysis.bugSeverity, category: analysis.category, reproductionSteps: analysis.reproductionSteps, potentialRootCause: analysis.potentialRootCause, suggestedPriority: analysis.suggestedPriority, estimatedComplexity: analysis.estimatedComplexity, estimatedHours: analysis.estimatedHours, recommendedDeveloper: analysis.recommendedDeveloper, assignedDeveloper: developerMapping[analysis.recommendedDeveloper] || "[email protected]", jiraLabels: [analysis.category, analysis.bugSeverity], jiraPriority: priorityMapping[analysis.suggestedPriority] || "Medium" }; ```

  6. Create Jira Ticket

    Use the Jira node to create a Bug issue. Set project to YOUR_JIRA_PROJECT_KEY, summary format to [GitHub #{issueNumber}] {title}, description includes reporter, GitHub link, original description, and AI analysis summary (severity, category, complexity, estimated hours, mentioned files, reproduction steps, root cause). additionalFields sets labels, assignee, and priority. Replace your-company.atlassian.net with your actual domain.

  7. Parallel Notify GitHub/Slack/Discord

    After Jira ticket creation, three branches execute in parallel: 1) GitHub node adds a comment to the original issue with Jira link, AI summary, assigned developer, and estimated time; 2) Slack node sends a rich message to the dev-alerts channel with title, severity, category, priority, assignee, estimated hours, root cause summary, and View in GitHub/Jira buttons; 3) Discord node sends a Markdown alert via webhook. Configure respective credentials and channel/webhook URLs.

  8. Return Webhook Response

    Use Respond to Webhook node to return JSON: {"status": "success", "message": "Bug report processed", "jiraTicket": $json.key}. Confirms successful processing, prevents GitHub retries, and logs are visible at GitHub Settings → Webhooks → Recent Deliveries.

Prompt you can copy

Setup guidance · Editorial suggestion。Setup assistant starter: confirm n8n instance and GitHub/Jira/OpenAI credentials exist before importing workflow JSON and customizing mappings

This block is the prompt. Ads are never placed here.

Import workflow.json first, then configure credentials and custom fields per node, finally test by creating a new GitHub issue to trigger the full pipeline

Source

GitHub to Jira bug sync with GPT-4o analysis & team alerts · SheCodesFlow · n8n.io · 2025-10-03

Comments & feedback

Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.

Loading…

    Related