Restructure CCP Metrics to metric-first hierarchy, fix Jira cross-project sync

CCP Metrics View Restructure:
- Add GET /metrics endpoint (aggregated across verticals)
- Add GET /metric/:id/verticals endpoint (per-vertical breakdown)
- Replace VerticalTable with MetricTable on overview (one row per metric)
- Add MetricDetailView for metric-first drill-down
- Restructure navigation: Metric → Vertical → Subteam → Devices
- Remove By Vertical table from AggregatedBurndownChart

Jira Sync Fix:
- Remove hardcoded project filter from getIssue() and searchIssuesByKeys()
- Issue keys are globally unique; project filter broke cross-project tickets
- Fixes 502 Bad Gateway when syncing tickets from non-STEAM projects
This commit is contained in:
Jordan Ramos
2026-05-20 13:30:22 -06:00
parent 64d5e0cb40
commit f00cce4cc1
4 changed files with 473 additions and 52 deletions

View File

@@ -0,0 +1,42 @@
# [Bug]: Jira sync fails for tickets in projects other than STEAM
**Labels:** kind/bug, status/resolved
## Description
Syncing individual Jira tickets (or bulk "Sync All") fails with a 502 "Failed to fetch issue from Jira" error when the ticket belongs to a Jira project other than the configured `JIRA_PROJECT_KEY` (STEAM). For example, ticket `AA_ADTRAN-541` in the `AA_ADTRAN` project cannot be synced because the JQL query hardcodes `AND project = STEAM`, which excludes all cross-project tickets.
This affects both single-ticket sync and the "Sync All" bulk operation.
## Steps to Reproduce
1. Go to the Jira Tickets page
2. Add or have a ticket with a key from a non-STEAM project (e.g., `AA_ADTRAN-541`)
3. Click the sync button on that ticket (or click "Sync All")
4. See browser alert: "Failed to fetch issue from Jira."
5. Console shows: `POST /api/jira-tickets/:id/sync` returns 502 (Bad Gateway)
## Environment
- Browser: Chrome (any)
- Server: Node.js on 71.85.90.9:3001
- Jira: Charter Jira Data Center (on-prem)
## Root Cause
`backend/helpers/jiraApi.js` — both `getIssue()` and `searchIssuesByKeys()` constructed JQL with `AND project = ${JIRA_PROJECT_KEY}` (resolves to `AND project = STEAM`). Since Jira issue keys are globally unique (the project prefix is part of the key), this filter is redundant for key-based lookups and breaks any ticket not in the STEAM project.
## Fix
Removed the `AND project = ${JIRA_PROJECT_KEY}` clause from:
- `getIssue()` — now uses `key = "${issueKey}"` only
- `searchIssuesByKeys()` — now uses `key in (...) AND updated >= -72h` only
`JIRA_PROJECT_KEY` is still used for issue creation (where it belongs).
## Relevant Log Output
```
POST http://71.85.90.9:3001/api/jira-tickets/:id/sync 502 (Bad Gateway)
Response: { "error": "Failed to fetch issue from Jira.", "details": "Issue not found" }
```