# JIRA AI Fixer - User Guide ## What is JIRA AI Fixer? JIRA AI Fixer is an AI-powered system that automatically analyzes support tickets from your issue tracking system, identifies the root cause in your codebase, and creates pull requests with suggested fixes. ## Supported Platforms | Platform | Status | Webhook Endpoint | |----------|--------|------------------| | TicketHub | ✅ Active | `/api/webhook/tickethub` | | JIRA | ✅ Ready | `/api/webhook/jira` | | ServiceNow | ✅ Ready | `/api/webhook/servicenow` | | Zendesk | ✅ Ready | `/api/webhook/zendesk` | | Azure DevOps | ✅ Ready | `/api/webhook/azure-devops` | | GitHub Issues | ✅ Ready | `/api/webhook/github` | | GitLab Issues | ✅ Ready | `/api/webhook/gitlab` | | Custom Systems | ✅ Ready | `/api/webhook/generic` | ## How It Works ``` 1. Ticket Created → 2. Webhook Sent → 3. AI Analyzes → 4. PR Created → 5. Result Posted (JIRA) (automatic) (30 seconds) (Gitea) (back to JIRA) ``` ### Step-by-Step Flow 1. **Ticket Created**: A support ticket is created in your issue tracker (JIRA, ServiceNow, etc.) 2. **Webhook Triggered**: Your issue tracker sends a webhook to JIRA AI Fixer 3. **AI Analysis**: The system: - Fetches relevant source code from your repositories - Sends the ticket description + code to an AI model - Identifies root cause and affected files - Generates a fix suggestion 4. **PR Created**: If a fix is found: - Creates a new branch (`fix/TICKET-123-auto-fix`) - Applies the code change - Opens a Pull Request with full explanation 5. **Result Posted**: A comment is added to your original ticket with: - Root cause analysis - Affected files - Suggested fix - Link to the Pull Request - Confidence score ## Setting Up Webhooks ### JIRA 1. Go to **Settings → System → Webhooks** 2. Click **Create a Webhook** 3. Set URL: `https://jira-fixer.startdata.com.br/api/webhook/jira` 4. Events: Select **Issue → created** 5. Save ### ServiceNow 1. Go to **System Web Services → Outbound → REST Message** 2. Create new REST Message pointing to: `https://jira-fixer.startdata.com.br/api/webhook/servicenow` 3. Create a Business Rule on Incident table to trigger on Insert ### Zendesk 1. Go to **Admin Center → Apps and integrations → Webhooks** 2. Create webhook with endpoint: `https://jira-fixer.startdata.com.br/api/webhook/zendesk` 3. Create Trigger: **When ticket is created → Notify webhook** ### Azure DevOps 1. Go to **Project Settings → Service hooks** 2. Create subscription for **Work item created** 3. Set URL: `https://jira-fixer.startdata.com.br/api/webhook/azure-devops` ### GitHub 1. Go to **Repository → Settings → Webhooks** 2. Add webhook: `https://jira-fixer.startdata.com.br/api/webhook/github` 3. Select events: **Issues** 4. Content type: `application/json` ### GitLab 1. Go to **Settings → Webhooks** 2. URL: `https://jira-fixer.startdata.com.br/api/webhook/gitlab` 3. Trigger: **Issues events** ### Custom System (Generic) Send a POST request with this format: ```json { "id": "your-ticket-id", "key": "PROJ-123", "title": "Issue title", "description": "Detailed description of the problem", "source": "your-system-name", "priority": "high", "labels": ["bug", "production"], "callback_url": "https://your-system.com/api/tickets/123/comments" } ``` ## Dashboard Access the dashboard at: **https://jira-fixer.startdata.com.br** ### Features - **Real-time Statistics**: Total issues, analyzed, PRs created, average confidence - **Issue List**: View all processed issues with status - **Issue Detail**: Click any issue to see full analysis, suggested fix, and PR link - **Filter by Source**: Filter issues by origin system (JIRA, ServiceNow, etc.) - **Filter by Status**: Filter by pending, analyzed, or error ## Understanding Results ### Analysis Comment Format When analysis completes, you'll see a comment like this: ``` 🤖 AI ANALYSIS COMPLETE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 ROOT CAUSE: The WS-AVAILABLE-BALANCE field is declared as PIC 9(9)V99 which can only hold values up to 9,999,999.99. Values above this are truncated. 📁 AFFECTED FILES: AUTH.CBL 🔧 SUGGESTED FIX: ──────────────────────────────────────── Change line 15 from: 05 WS-AVAILABLE-BALANCE PIC 9(9)V99. To: 05 WS-AVAILABLE-BALANCE PIC 9(11)V99. ──────────────────────────────────────── 🔀 PULL REQUEST CREATED: ──────────────────────────────────────── Branch: fix/supp-1-auto-fix PR: #5 URL: https://gitea.startdata.com.br/startdata/cobol-sample-app/pulls/5 ──────────────────────────────────────── 📊 CONFIDENCE: 92% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Analyzed by JIRA AI Fixer ``` ### Confidence Score | Score | Meaning | |-------|---------| | 90-100% | Very likely correct - review and merge | | 70-89% | Probably correct - review carefully | | 50-69% | Uncertain - manual investigation recommended | | <50% | Low confidence - use as a starting point only | ## Best Practices ### Writing Good Ticket Descriptions The AI works best with detailed descriptions: **Good:** ``` Transaction auth failing for amounts over $10 million. - Error: "Insufficient funds" even when balance is adequate - Affected accounts: Corporate accounts with high limits - Started after last month's release - Error code: AUTH-5012 ``` **Poor:** ``` auth broken ``` ### Reviewing PRs 1. Always review AI-generated PRs before merging 2. Run your test suite on the fix branch 3. Check if the analysis matches your understanding 4. Look for edge cases the AI might have missed ## Troubleshooting ### Issue Not Analyzed 1. Check webhook delivery in your issue tracker 2. Verify the endpoint URL is correct 3. Check the JIRA AI Fixer dashboard for errors ### Low Confidence Scores 1. Provide more detail in ticket descriptions 2. Ensure relevant code is in indexed repositories 3. Check if the issue type is supported ### PR Not Created 1. Repository must be connected to Gitea 2. Code must be in indexed directory 3. Fix must be auto-applicable (simple changes work best) ## Contact - **Dashboard**: https://jira-fixer.startdata.com.br - **Portal**: https://aifixerportal.startdata.com.br - **Support**: support@startdata.com.br --- *JIRA AI Fixer - Intelligent Support Case Resolution* *Created by StartData*