jira-ticket-summarizer
v1.0.1-alpha-b9721a.0
Published
JIRA support ticket fetcher and summarizer using Cursor AI
Maintainers
Readme
JIRA Ticket Summarizer
Cursor Commands with Node.js scripts to fetch and summarize JIRA support tickets (both closed and current). The generated AI-powered summaries will provide developers with additional context to help solve new cases and manage the current workload. It could be helpful for managers to better understand the current situation with the support tickets.
Features
- 🎯 Fetch JIRA tickets using custom JQL queries (closed or current)
- 💬 Automatically retrieve all comments for each ticket
- 📝 Generate AI-powered summaries using Cursor
- 🔧 Configurable project, time range, and mode (closed/current)
- 📦 Save tickets as JSON and summaries as Markdown
- 📊 Two summary modes:
- Closed tickets: Pattern analysis (root causes, solutions)
- Current tickets: Workload analysis (assignees, priorities, status)
Prerequisites
- Node.js 22+ with npm
- JIRA Cloud account with API access
- Cursor IDE
Setup
1. Install Dependencies
npm install2. Configure JIRA Credentials
Copy the example environment file and fill in your credentials:
cp .env.example .envEdit .env with your JIRA details:
JIRA_URL=https://your-domain.atlassian.net
[email protected]
JIRA_API_TOKEN=your-api-token
JIRA_DEFAULT_PROJECT=ABC
JIRA_DEFAULT_DAYS_BACK=7To generate a JIRA API token:
- Go to https://id.atlassian.com/manage/api-tokens
- Click "Create API token"
- Give it a name and copy the token
- Paste it into your
.envfile
3. Build the Project
npm run buildUsage
Summarize Closed Tickets
Type in Cursor chat:
/summarize-closed-ticketsThis will:
- Fetch closed tickets from ${JIRA_DEFAULT_PROJECT} project (last ${JIRA_DEFAULT_DAYS_BACK} days)
- Analyze all tickets together to identify patterns
- Generate a SINGLE comprehensive summary (
tickets/SUMMARY.md) with:- Similar cases grouped by root cause
- Similar cases grouped by solution
- Resolution time statistics
- Additional helpful information
You can also specify the project and days back value:
/summarize-closed-tickets Project RES, days back 14Summarize Current Tickets
Type in Cursor chat:
/summarize-current-ticketsThis will:
- Fetch current tickets (In Progress or New) from ${JIRA_DEFAULT_PROJECT} project
- Analyze workload distribution and priorities
- Generate a SINGLE comprehensive summary (
tickets/SUMMARY.md) with:- Workload grouped by assignee
- Tickets grouped by priority
- Status breakdown (New vs In Progress)
- Oldest tickets needing attention
- Actionable recommendations
You can also specify the project:
/summarize-current-tickets Project RESOutput
Tickets Directory
Fetched tickets are saved to tickets/ directory:
tickets/{TICKET-KEY}.json- Raw ticket data with comments
Summaries
AI-generated summary is saved to:
tickets/SUMMARY.md- Comprehensive analysis of all tickets (format depends on mode)
JQL Queries
Closed Tickets Mode (default)
project = ${JIRA_DEFAULT_PROJECT}
AND type IN ("Support Ticket", "Support Task")
AND statuscategory = Complete
AND resolved >= -${JIRA_DEFAULT_DAYS_BACK}d
ORDER BY resolved DESCCurrent Tickets Mode
project = ${JIRA_DEFAULT_PROJECT}
AND type IN ("Support Ticket", "Support Task")
AND statuscategory IN ("In Progress", New)
ORDER BY assignee DESC, statusCategory DESC, priority DESC, created DESCProject Structure
support-tickets-summary/
├── .cursor/ # Cursor IDE configuration
│ └── commands/
│ ├── summarize-closed-tickets.md # Command for closed tickets
│ └── summarize-current-tickets.md # Command for current tickets
├── .env # Your JIRA credentials (not in git)
├── .env.example # Template for credentials
├── .nvmrc # Node version specification
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
├── README.md # This file
├── src/
│ ├── fetch-tickets.ts # Main script (supports both modes)
│ ├── types.ts # TypeScript interfaces
│ └── utils/
│ ├── jira-client.ts # JIRA API wrapper
│ └── file-utils.ts # File operations
├── dist/ # Compiled JavaScript (generated)
│ ├── fetch-tickets.js
│ ├── types.js
│ └── utils/
└── tickets/ # Output directory
├── *.json # Fetched tickets
└── SUMMARY.md # AI-generated comprehensive analysisTicket Data Structure
Each ticket JSON file contains:
{
key: string; // e.g., "RES-1234"
summary: string; // Ticket title
status: string; // e.g., "Done"
issueType: string; // e.g., "Support Ticket"
created: string; // ISO date
updated: string; // ISO date
description?: string; // Ticket description
statusCategory?: string; // e.g., "Complete"
priority?: string; // e.g., "High"
resolved?: string; // ISO date
reporter?: string; // Reporter name
assignee?: string; // Assignee name
comments: [ // Array of comments
{
author: string;
body: string;
created: string;
}
]
}Summary Formats
The AI-generated summary format depends on the mode:
Closed Tickets Summary
- Executive Summary - Overview of all tickets and key trends
- Analysis by Root Cause - Groups similar tickets by underlying issue
- Analysis by Solution - Groups tickets by resolution approach
- Individual Ticket Details - Quick reference for each ticket
- Resolution Time Statistics - Performance metrics
Current Tickets Summary
- Executive Summary - Workload overview and urgent items
- Immediate Actions Required - Specific actions needed for individual tickets (move to different team, reassign, unblock, clarify, etc.)
- Workload by Assignee - Distribution of tickets per team member
- High Priority Tickets - Urgent items requiring attention
- New vs In Progress - Status breakdown
- Oldest Tickets - Items that have been open longest
- All Tickets by Status and Priority - Complete ticket listing
Troubleshooting
Authentication Errors
If you see authentication errors:
- Verify your JIRA_URL is correct (should include https://)
- Check that your JIRA_EMAIL matches your account
- Regenerate your JIRA_API_TOKEN if needed
No Tickets Found
If no tickets are returned:
- Verify the project key exists (e.g., "RES")
- Check that tickets match the JQL criteria
- Ensure you have permission to view the project
Development
Modifying the JQL Queries
Edit src/fetch-tickets.ts and modify the buildJqlQuery function to customize the query logic for either mode (closed or current).
CLI Arguments
The fetch script supports the following arguments:
--project <PROJECT_KEY>- JIRA project key (default: from .env)--days <NUMBER>- Number of days back for closed tickets (default: from .env)
Example:
npm run fetch:closed --project RES --days 14
npm run fetch:current --project RESLicense
ISC
Contributing
Feel free to submit issues and enhancement requests!
