A Node.js application that generates weekly reports from Jira by fetching issues from specific projects that have received comments in the past 7 days.
- Fetches issues from PF and UXDENG projects
- Automatically detects current quarter and year for filtering (e.g., "Q4 2025")
- Supports custom affected version specification via environment variable or GitHub Action input
- Identifies issues with comments added in the past 7 days
- Extracts and summarizes recent comments for each issue
- Generates both console output and JSON report file
- Node.js (version 18 or higher)
- Jira Personal Access Token (PAT)
- Access to Red Hat Jira instance (https://issues.redhat.com) with PF and UXDENG projects
-
Clone/Download the project
cd jira-weekly-report -
Install dependencies
npm install
-
Configure environment variables
Create a
.envfile in the root directory:touch .env
Edit the
.envfile with your Jira credentials:JIRA_PAT=your_personal_access_token_here # Optional: Override the affected version (defaults to current quarter) # AFFECTED_VERSION=Q4 2025 -
Generate a Jira Personal Access Token
- Go to https://issues.redhat.com
- Navigate to Account Settings → Security → API tokens
- Create a new token and copy it to your
.envfile
npm startnpm run devThis project includes a GitHub Actions workflow that automatically runs the report generation:
- Scheduled: Runs every Thursday at 1:00 PM UTC (uses current quarter automatically)
- Manual trigger: Can be manually triggered from the Actions tab with optional affected version input
- Dynamic quarter detection: Automatically detects current quarter (Q1-Q4) and year when no input is provided
- Custom affected version: When manually triggered, you can specify a custom affected version (e.g., "Q3 2025")
- Artifact output: Generated JSON reports are uploaded as artifacts with 3-day retention
- Environment: Uses the
JIRA_PATsecret for authentication
The workflow automatically handles the report generation and makes the JSON output available for download without committing files to the repository.
The application will:
-
Console Output: Display a formatted report with:
- Issue key and summary
- Issue URL
- Number of recent comments
- Comment details (author, date, text preview)
-
JSON File: Save a detailed report as
jira-weekly-report-YYYY-MM-DD.jsoncontaining:- Generation timestamp
- Search criteria used
- Complete issue and comment data
Note: When running via GitHub Actions, the JSON file is automatically uploaded as an artifact and available for download from the Actions tab, rather than being committed to the repository.
🔍 Searching for issues in PF and UXDENG projects with Q4 2025 affected version...
Found 3 issues with recent comments
📊 WEEKLY JIRA REPORT
====================
Generated at: 2024-01-15T10:30:00.000Z
Projects: PF, UXDENG
Affected Version: Q4 2025
Comments Period: Last 7 days
Found 3 issues with recent comments:
1. PF-1234: Fix component styling issues
URL: https://issues.redhat.com/browse/PF-1234
Recent Comments: 2
Comment 1:
Author: John Doe
Date: 1/14/2024
Text: Updated the CSS to fix the alignment issue...
2. UXDENG-5678: Update design tokens
URL: https://issues.redhat.com/browse/UXDENG-5678
Recent Comments: 1
Comment 1:
Author: Jane Smith
Date: 1/13/2024
Text: Added new color tokens as requested...
💾 Report saved as: jira-weekly-report-2024-01-15.json
The application dynamically generates its JQL query based on the current quarter and year (or specified affected version):
project in (PF, UXDENG) AND
type = "Epic" AND
affectedVersion = "[Current Quarter YYYY]" AND
updated >= -4d
Quarter Calculation:
- Q1: January, February, March
- Q2: April, May, June
- Q3: July, August, September
- Q4: October, November, December
Customization Options:
- Set
AFFECTED_VERSIONenvironment variable to override quarter detection - Use GitHub Action input for manual runs with custom affected version
- Modify search criteria by editing the
searchIssues()function insrc/index.js
The application includes error handling for:
- Missing environment variables
- Jira API connection issues
- Invalid responses
- Network timeouts
- axios: HTTP client for Jira API calls
- dotenv: Environment variable loading
- date-fns: Date manipulation and formatting
GET https://issues.redhat.com/rest/api/2/search- Search for issuesGET https://issues.redhat.com/rest/api/2/issue/{issueKey}/comment- Fetch issue comments
- Authentication errors: Verify your JIRA_PAT is valid and has necessary permissions
- No issues found: Check if the affected version exists in your projects. The application auto-detects current quarter (e.g., "Q4 2025") or uses your custom
AFFECTED_VERSIONif specified - Wrong quarter detected: Verify the current date - quarters are calculated as Q1 (Jan-Mar), Q2 (Apr-Jun), Q3 (Jul-Sep), Q4 (Oct-Dec)
- Custom affected version not working: Ensure
AFFECTED_VERSIONenvironment variable is set correctly (format: "Q# YYYY") - Connection issues: The application connects to https://issues.redhat.com - ensure you have access to this Jira instance
MIT