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

@@ -276,7 +276,9 @@ function jiraDelete(urlPath, options) {
* @param {string[]} [fields] - Jira field names to return
*/
async function getIssue(issueKey, fields) {
const jql = `key = "${issueKey}" AND project = ${JIRA_PROJECT_KEY}`;
// Don't filter by project — issue keys are globally unique in Jira and
// tickets may belong to projects other than JIRA_PROJECT_KEY (e.g. AA_ADTRAN).
const jql = `key = "${issueKey}"`;
const result = await searchIssues(jql, { fields: fields || DEFAULT_FIELDS, maxResults: 1, startAt: 0 });
if (result.ok && result.data.issues && result.data.issues.length > 0) {
return { ok: true, data: result.data.issues[0] };
@@ -300,11 +302,10 @@ async function searchIssuesByKeys(issueKeys, opts) {
return { ok: true, data: { total: 0, issues: [] } };
}
// Build JQL: key in (KEY-1, KEY-2, ...) — Charter requires project+updated
// or similar, but key-based search is inherently scoped. We add updated
// clause for compliance.
// Build JQL: key in (KEY-1, KEY-2, ...) — issue keys are globally unique,
// so no project filter needed. Add updated clause for Charter compliance.
const keyList = issueKeys.map(k => `"${k}"`).join(', ');
const jql = `key in (${keyList}) AND updated >= -72h AND project = ${JIRA_PROJECT_KEY}`;
const jql = `key in (${keyList}) AND updated >= -72h`;
const fields = (opts && opts.fields) || DEFAULT_FIELDS;
const maxResults = Math.min((opts && opts.maxResults) || 1000, 1000);