Back to projects
CloudBackendAIAutomated Sprint Telemetry & Governance

Sprint Analytics Pipeline

Enterprise Jira sprint telemetry and analytics pipeline with automated Confluence dashboards, developer velocity metrics, and LLM blocker summarization.

Timeline: Feb 2026

Technology Stack

PythonGCPBigQueryJira APIConfluence APITerraformDocker

HSTG Digital Jira Report Generator

Generates Jira sprint reports for multiple teams, posts one consolidated page to Confluence, and notifies a Microsoft Teams channel. Includes Developer lookup: open the report and use the link (or embedded iframe) to look up a developer and see their story points and issues.

Jira Sprint Report

Features

  • Multi-team reports from team_config.py (board ID per team, optional members / excluded sprints)
  • Single Confluence page — the same page is updated each run; sprint details, spillover, verification violations, Blockers (from Jira). Uses Confluence REST API v2 for better performance and reliability.
  • Sprint details table — Sprint name, Actual Start/End, Completed story points, Issues in Sprint, Issues in backlog, Issues with no story points, Total Story Points
  • Spillover — Issues not completed in the last closed sprint (table: Issue, Summary, Assignee, Label e.g. tech-debt)
  • Blockers section — Issues on Backlog then Issues on Hold, each line: Ticket number - Status - Description (from Jira; backlog first, then on hold). Comment summaries for those issues are generated by the LLM (Groq or Gemini); LLM is required for the report.
  • Jira Verification Violations — Doughnut chart by type + Per-issue details table (Issue, Status, Assignee, Violations). Rules are status-dependent: In Progress → +1 AC only; In Test → +1 AC + PR link; Ready for Production / Resolved → all 7 (PR link, branch cleanup, Concourse, rollback, evidence labels, time logged)
  • Story point breakdown (Developer lookup) — Not started, In progress, Completed, Blocked/On hold (board column or status name)
  • Teams notification with Confluence link (date in IST)
  • Developer lookup — Link and optional iframe on Confluence; type name, pick team/sprint, fetch to see story points and issue list
  • Cloud Scheduler — Run the report on a schedule (default: daily Mon-Sat 7 AM IST; configurable)

Prerequisites

  • Python 3.11+
  • Jira account + API token
  • Confluence space (for the report page)
  • Microsoft Teams incoming webhook (for the report link)
  • Groq or Gemini API key (required for LLM-generated comment summaries under Blockers)

How to run

📋 Step-by-step guide: all ways to run the report + Developer lookup — Run the report (once, web app, GCP, cron, GitHub Actions, HTTP trigger) and how to use the HTML Developer lookup page (enter name, team, sprint → fetch from Jira).

🚀 GitHub Actions + host Developer lookup (Render or Railway) — Schedule the report with GitHub Actions (daily Mon-Sat 7 AM IST) and host the Developer lookup at a public URL. Use Render (free or paid) or Railway (Hobby ~$5/mo for always-on). For Render deploy steps, see RENDER_DEPLOY_CHECKLIST.md.

Step 1: Clone and install

cd /path/to/Jira
pip install -r requirements.txt

Step 2: Configure environment

cp .env.example .env

Edit .env and set at least:

VariableRequiredDescription
JIRA_USER_NAMEYesJira user email
JIRA_TOKENYesJira API token
CONFLUENCE_BASE_URLFor reporte.g. https://your-site.atlassian.net/wiki
CONFLUENCE_USERFor reportConfluence user email
CONFLUENCE_TOKENFor reportConfluence API token
CONFLUENCE_SPACE_KEYFor reportSpace key (e.g. HGD)
VELOCITY_DASHBOARD_URLOptionalLink under the Velocity heading (replaces inline table)
TEAMS_WEBHOOKFor reportTeams incoming webhook URL
LLM_PROVIDERFor reportgroq or gemini (required for Blockers comment summaries)
GROQ_API_KEYIf groqGroq API key (required when LLM_PROVIDER=groq)
GEMINI_API_KEY or GOOGLE_API_KEYIf geminiGemini/Google AI key (required when LLM_PROVIDER=gemini)
APP_BASE_URLFor Person Lookup on ConfluencePublic URL of this app (see Step 4 / Deploy)

Step 3: Configure teams

Edit team_config.py: set board_id for each team. Use members: [] to auto-detect assignees from the sprint.

Step 4: Run locally

Option A – Generate the report once (no browser)

python main.py

Runs the full flow (fetch from Jira, build report, post to Confluence, send link to Teams) and exits.

Option B – Run the web app (report + Person Lookup in browser)

functions_framework --target=generate_and_send_report --port=8080 --debug

Use --debug so the app runs in a single process (Flask dev server). That can avoid worker crashes (SIGSEGV) you may see when hitting /report with the default multi-worker setup. Keep the terminal running. Then:

What you wantOpen in browser
Developer lookup (name, team/sprint, fetch)http://localhost:8080/ or http://localhost:8080/person
Run the report manuallyhttp://localhost:8080/report

For Developer lookup to appear on the Confluence page when deployed, set APP_BASE_URL in .env (e.g. http://localhost:8080 locally, or your Cloud Function URL in production).

Step 5: Run with Docker (optional)

Run the app in a containerized environment using Docker:

Build the Docker image:

docker build -t jira-report-app .

Run the container:

docker run -p 8080:8080 --env-file .env jira-report-app

The app will be available at:

Notes:

  • The --env-file .env flag loads all environment variables from your .env file
  • The Dockerfile uses the same functions-framework entry point as local/GCP deployment
  • Uses Python 3.11 slim image with minimal dependencies
  • Port 8080 is exposed by default (configurable via PORT environment variable)

Alternative: Run with docker-compose (create docker-compose.yml first):

version: '3.8'
services:
  jira-report:
    build: .
    ports:
      - "8080:8080"
    env_file:
      - .env

Then run:

docker-compose up

Step 6: Deploy to Google Cloud (production)

  1. In .env, set:
    • GCP_PROJECT_ID, GCP_REGION, CLOUD_FUNCTION_NAME
    • All vars from Step 2 (Jira, Confluence, Teams, LLM)
  2. Run:
./deploy.sh

This will:

  • Deploy the app as a Cloud Function (HTTP).
  • Create a Cloud Scheduler job that calls the function daily Monday through Saturday at 7:00 AM IST at /report (generates the report and posts to Confluence + Teams).
  1. After the first deploy: copy the function URL from the script output and set in .env:

    APP_BASE_URL=https://REGION-PROJECT.cloudfunctions.net/FUNCTION_NAME
    

    Then run ./deploy.sh again so the function gets APP_BASE_URL. The Confluence report will then show the Developer lookup section (link and optional embedded iframe).

Deploy to Cloud Run (alternative):

If you prefer Cloud Run over Cloud Functions:

# Build and push to Google Container Registry
gcloud builds submit --tag gcr.io/$GCP_PROJECT_ID/jira-report

# Deploy to Cloud Run
gcloud run deploy jira-report \
  --image gcr.io/$GCP_PROJECT_ID/jira-report \
  --platform managed \
  --region $GCP_REGION \
  --allow-unauthenticated \
  --set-env-vars="$(cat .env | grep -v '^#' | xargs | tr ' ' ',')"

Schedule: Default is daily Mon-Sat 7:00 AM IST (30 1 * * 1-6). To change it, set in .env before deploying:

SCHEDULE_CRON="30 1 * * 1-6"    # 1=Mon, 6=Sat (0=Sun)
SCHEDULE_TIMEZONE=Asia/Kolkata

Alternative: Terraform Use main.tf and terraform.tfvars (copy from terraform.tfvars.example) to provision the Cloud Function and Scheduler. Set teams_webhook, Confluence vars, and LLM keys in terraform.tfvars. The app uses a single Teams webhook for the report link.


Other ways to run the report on a schedule (no Cloud Function + Scheduler)

If you prefer not to use GCP Cloud Function + Cloud Scheduler, you can run the report on a schedule with one of these:

OptionBest forNotes
Cron on a serverYou have a Linux/macOS VM or always-on machineRun python main.py or curl http://your-app/report at any schedule you want. No cloud scheduler needed.
GitHub ActionsRepo is on GitHub; you're okay running in CIIncluded workflow runs daily Mon-Sat at 7 AM IST (30 1 * * 1-6 in UTC = 01:30 UTC). Customize the schedule in .github/workflows/jira-report.yml. Store secrets in repo secrets.
Cloud Run Job + SchedulerYou want to stay on GCP but not use a FunctionDeploy the app as a Cloud Run Job (runs to completion). Use Cloud Scheduler to invoke the job at the same cron.
Other cloudsYou already use AWS/AzureAWS: Lambda + EventBridge schedule. Azure: Function App with timer trigger. You’d deploy the same Python app and call the report entrypoint on schedule.

Cron example (server / VM): Use the same cron expression in the server’s timezone (e.g. if the server is in IST):

# crontab -e  (Mon & Thu 9:00 AM)
0 9 * * 1,4 cd /path/to/Jira && /usr/bin/python3 main.py

If the server is in UTC, 9 AM IST = 03:30 UTC:

30 3 * * 1,4 cd /path/to/Jira && /usr/bin/python3 main.py

GitHub Actions: A workflow is included at .github/workflows/jira-report.yml — runs daily Mon-Sat at 7:00 AM IST (30 1 * * 1-6 = 01:30 UTC). To customize the schedule, edit the cron expression in the workflow file. Add repository secrets: JIRA_USER_NAME, JIRA_TOKEN, TEAMS_WEBHOOK, CONFLUENCE_*, LLM_PROVIDER, GROQ_API_KEY or GEMINI_API_KEY. For the Developer lookup and Sprint metrics dashboard links to appear in the Confluence report, also add APP_BASE_URL (your hosted app URL, no trailing slash) and optionally VELOCITY_DASHBOARD_URL. See GITHUB_ACTIONS_AND_DEVELOPER_LOOKUP.md. Trigger the workflow manually from the Actions tab.


End-to-end flow

  1. Report is generated Either by Cloud Scheduler (daily Mon-Sat 7 AM IST for GCP deployments), GitHub Actions (daily Mon-Sat 7 AM IST), or manually (e.g. python main.py or http://localhost:8080/report). The app posts one Confluence page with all teams' sections.

  2. You open the Confluence page From the link in Teams or from your Confluence space. You see the full report: date, teams included, Developer lookup link, then per team — sprint details, naming alerts (if any), Jira Verification Violations (doughnut + per-issue table), spillover, and Blockers (Issues on Backlog, then Issues on Hold; each line: Ticket number - Status - Description).

  3. Developer lookup Scroll to the bottom of the Confluence page. Use "Open Developer lookup in a new tab" (recommended; Confluence often blocks iframes). Type the developer name, select team and sprint, click Fetch from Jira to see story points (Total, Not started, In progress, Completed, Blocked/On hold) and the issue list.


Project structure

.
├── main.py                   # HTTP entrypoint: routing, report, Person Lookup API
├── config.py                 # Env, Jira/Confluence config, centralized matplotlib setup
├── team_config.py            # Teams, board IDs, optional members, violation labels
├── jira_api/
│   ├── jira_sprint.py        # Sprint info, spillover, velocity (consolidated board cache)
│   ├── jira_issues.py        # Issue fetch, team members, backlog/on-hold, verification
│   └── verification_helpers.py  # Status-dependent checklist (+1 AC, PR link, evidence, etc.)
├── report/
│   ├── report_builder.py     # Build team reports and consolidated Confluence content
│   ├── violations_chart.py  # Verification violations: doughnut chart, stacked bar, summary table
│   └── llm_report.py        # LLM for Blockers comment summaries (required)
├── clients/
│   ├── confluence_client.py # Post/update Confluence page (REST API v2)
│   └── teams_client.py       # Post to Teams webhook
├── person/
│   └── person_lookup.py      # Developer list, sprints, person details (with performance logging)
├── utils/
│   ├── jira_helpers.py       # Shared Jira utilities (story points parsing, field extraction)
│   └── markdown.py           # Markdown/table helpers (e.g. escape for table cells)
├── static/
│   └── person.html           # Person Lookup UI (embedded on Confluence)
├── docs/
│   ├── RUNNING_THE_REPORT.md                      # All ways to run report + Developer lookup
│   ├── GITHUB_ACTIONS_AND_DEVELOPER_LOOKUP.md     # GitHub Actions + host lookup (Render/Railway)
│   └── RENDER_DEPLOY_CHECKLIST.md                 # Render deploy checklist (env vars, Docker, instance type)
├── requirements.txt          # All dependencies
├── .env.example
├── deploy.sh                 # Deploy Cloud Function + Scheduler (with comprehensive validation)
├── main.tf                   # Optional: Terraform for function + scheduler
├── terraform.tfvars.example
├── Dockerfile                # Container image for Cloud Run / local
└── README.md

Configuration

  • JQL and issue types: Only Story and Bug are included in the report and Developer lookup (see JIRA_REPORT_ISSUE_TYPES_JQL in team_config.py). JIRA_CUSTOM_JQL_FILTER is applied where relevant (e.g. report JQL, spillover fallback). Issues in Sprint counts parent issues only (no subtasks).
  • Sprint metrics dashboard: Set VELOCITY_DASHBOARD_URL in .env (or in GitHub Secrets when using Actions) to show a Sprint metrics dashboard link on the report.
  • Developer lookup / report links: Set APP_BASE_URL (and optionally VELOCITY_DASHBOARD_URL) so the Confluence report shows the Developer lookup link and Sprint metrics dashboard link. When using GitHub Actions, add these as repository secrets so the scheduled report includes the links.
  • Sprint naming: Report warns if the name doesn’t match PI<X> S<X> Squad_Name; it does not change behavior.
  • Rate limiting: 15-second delay between teams when generating the report.
  • Confluence page: Fixed title "HSTG Digital Sprint status report". Uses Confluence REST API v2 with automatic space key → space ID conversion. Each run updates that page if it exists; otherwise a new page is created.
  • Jira Verification Violations: Per team: doughnut chart (counts by type) and Per-issue details table (Issue, Status, Assignee, Violations). Violation types are defined in team_config.py (VIOLATION_LABELS and VIOLATION_SHORT): Missing +1 AC comment, Missing PR link, No time logged, No dev/local evidence, Branch Cleanup not mentioned, Concourse link not pasted, Rollback strategy not mentioned. PR link is detected in comments (including ADF), issuelinks, or Development/remotelinks.
  • Developer lookup: Story point breakdowns (Sprint and This person's) are shown as doughnut charts alongside the cards. Only Story and Bug issues are shown. Performance logging tracks slow sprint lookup operations (fallback queries with timing).
  • Blockers section: List is from Jira: Issues on Backlog then Issues on Hold, each line Ticket number - Status - Description (backlog first, then on hold). Comment summaries are generated by the LLM (required): set LLM_PROVIDER (groq or gemini) and the corresponding API key. For GCP/Vertex AI, Vertex AI Gemini 2.0 Flash or Gemini 2.0 Flash Lite are options. See Vertex AI pricing.
  • Logging: Most operational logs are at DEBUG. Use logging.getLogger("jira_api.jira_sprint").setLevel(logging.DEBUG) (or similar) to see spillover/board details. Performance-sensitive operations (e.g., sprint lookup fallback) now log at INFO with timing information.

Troubleshooting

"Failed to load developers" on Developer lookup page

The page shows the error in the Developer/Team area. Common causes:

  • Jira credentials: Ensure JIRA_USER_NAME and JIRA_TOKEN in .env are correct and the user has access to the boards in team_config.py.
  • Network: If the app runs in a restricted environment, Jira API calls may fail; check firewall/proxy.
  • Server crash: If the server is crashing (see SIGSEGV below), the request to /api/developers may never complete. Use --debug when running locally.

SIGSEGV when opening /report or when loading developers

The log shows Worker (pid:...) was sent SIGSEGV! and the browser may show "This page isn't working" / "ERR_EMPTY_RESPONSE". Try:

  1. Run with a single process (recommended for local): Run with Docker | docker build -t jira-report-app . && docker run -p 8080:8080 --env-file .env jira-report-app | | Deploy to GCP (Functions) | ./deploy.sh | | Deploy to GCP (Cloud Run) | `gcloud builds submit --tag gcr.io/$GCP_PROJECT_ID/jira-report && gcloud run deploy jira-report --image gcr.io/$GCP_PROJECT_ID/jira-report --platform managed --region $GCP_REGION --allow-unauthenticated functions_framework --target=generate_and_send_report --port=8080 --debug

    `--debug` uses the Flask dev server instead of multi-worker gunicorn, which often avoids this crash.
    
    
  2. Confirm the report runs outside the server: Run python main.py in the same environment. If that completes without a crash, the issue is likely the HTTP worker process; --debug should help. If python main.py also crashes, the segfault is probably in a native dependency (e.g. Jira client, SSL, or LLM library). Try updating: pip install --upgrade jira requests.

  3. Check dependencies: SIGSEGV can come from C extensions (e.g. in cryptography, requests). Ensure you're on a supported Python version and that packages are installed for your platform.


Useful commands

TaskCommand
Run report oncepython main.py
Start web app (local)functions_framework --target=generate_and_send_report --port=8080 --debug
Deploy to GCP./deploy.sh
Trigger scheduler manuallygcloud scheduler jobs run CLOUD_FUNCTION_NAME-scheduler --location=GCP_REGION
View function logsgcloud functions logs read CLOUD_FUNCTION_NAME --region=GCP_REGION --limit=50
Run report via GitHub ActionsAdd secrets (see docs), then Actions → Jira Sprint Report → Run workflow

Documentation

DocDescription
RUNNING_THE_REPORT.mdAll ways to run the report (local, web app, GCP, cron, GitHub Actions, HTTP) + how to use the Developer lookup page
GITHUB_ACTIONS_AND_DEVELOPER_LOOKUP.mdGitHub Actions for scheduled report (daily Mon-Sat 7 AM IST) + host Developer lookup on Render or Railway
RENDER_DEPLOY_CHECKLIST.mdStep-by-step Render deploy (env vars, Docker, instance type, health check)

Recent Optimizations

This codebase has been optimized for maintainability, performance, and reliability:

Code Quality

  • Eliminated ~140+ lines of duplicate code across multiple modules
  • Created utils/jira_helpers.py - Shared story points parsing logic, eliminating circular imports
  • Consolidated board caching - Single _board_cache structure replacing 3 separate caches
  • Refactored report generation - Extracted _generate_reports_internal() helper to eliminate ~100 lines of duplication between HTTP and CLI modes

Configuration & Deployment

  • Centralized configuration - Matplotlib setup in config.py, violation labels in team_config.py
  • Enhanced deployment validation - deploy.sh now validates all required environment variables (GCP, Jira, Teams, LLM) with color-coded output
  • Dependency pinning - Pinned markdown==3.7.0 to prevent version mismatch issues

Error Handling & Monitoring

  • Specific exception types - Added JIRAError and RequestException handling across 7+ files
  • Performance logging - Sprint lookup fallback now logs timing (e.g., "50 queries in 3.25s")
  • Better error visibility - Successful lookups promoted from DEBUG to INFO level

API Upgrades

  • Confluence REST API v2 - Upgraded from v1 with automatic space key → space ID conversion
  • Table width fix - Confluence tables properly formatted with div wrappers and inline styles

License

Internal use. Adjust team_config.py and .env for your org.

AI Career Assistant
Hi! I'm an AI assistant for Kiruthick's portfolio. Ask me about his projects, experience, or skills.