feat(ci): add Jira ↔ GitHub sync workflow#795
Conversation
Adds jira-sync.yml — an agentic workflow that uses Claude Code to keep
GitHub PRs, GitHub Issues, and Jira in two-way sync on a daily schedule
and on PR lifecycle events.
Phases:
1. Open PR health check: stale detection, Jira link enforcement,
status sync (New → In Progress), two-way remote links
2. Merged PR audit: transitions Jira to Resolved for PRs merged
in the last 7 days
3. GitHub issue sync: ensures every open GH issue has a Jira ticket
linked in the description
4. Sprint epic alignment: flags active sprint items with no epic link
Required secrets: JIRA_BASE_URL, JIRA_USERNAME, JIRA_API_TOKEN,
JIRA_BOARD_ID (CLAUDE_CODE_OAUTH_TOKEN already exists)
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The Claude Code OAuth token already includes Jira MCP access, so no separate JIRA_BASE_URL / JIRA_USERNAME / JIRA_API_TOKEN secrets are needed. Rewrote all Jira operations to use mcp__jira__* tools directly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Look up the PR author's email from GitHub (profile then commits fallback) and resolve their Jira account via jira_get_user_profile instead of maintaining a brittle static map that drifts over time. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Remove pull_request trigger — schedule + workflow_dispatch only - Drop all per-phase skip conditions and trigger env vars - Set components="Agentic" and customfield_12313240="Ambient team" on every Jira issue created so they appear in team filters/board Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
- Add absolute rule at top of prompt: never touch issues where customfield_12313240 != "Ambient team" - Verify team field on any individually fetched issue before acting - Bake the team filter into every JQL query in the prompt - Simplify epic search JQL — team filter is sufficient, no need for label/summary heuristics Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Claude Code ReviewSummaryThis PR introduces a single GitHub Actions workflow ( Issues by SeverityBlocker Issues[BLOCKER-1] Prompt injection via untrusted PR/issue content
Critical Issues[CRITICAL-1]
[CRITICAL-2] PR description lists 4 required secrets that are absent from the workflow
Major Issues[MAJOR-1]
[MAJOR-2] Per-run GitHub issue creation will generate significant issue noise
[MAJOR-3] Autonomous PR body and label mutations have no dry-run option
Minor Issues[MINOR-1] PR description mentions triggers that don't exist in the workflow
[MINOR-2]
Positive Highlights
Recommendations (priority order)
Review generated by Claude Code — Sonnet 4.6 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Claude Code ReviewSummaryPR 795 adds Issues by SeverityBlocker IssuesNone. Critical Issues1. Unpinned action version — supply chain risk The step uses Standard violated: Supply chain hardening for GitHub Actions. Fix: Pin to a specific commit SHA: uses: anthropics/claude-code-action@<commit-sha>Get the SHA: Major Issues2. Unnecessary The permissions block includes Standard violated: Principle of least privilege. Fix: Remove 3. PR description references secrets and triggers absent from the workflow YAML The PR description claims triggers include PR lifecycle events ( The description also lists Impact: Operators following the PR description will add three unused secrets and expect PR-event triggers that will never fire. Fix: Update the PR description — remove the three unused Jira secrets and remove PR lifecycle events from the triggers list. 4. GitHub Issues processed without author filtering in Phase 3 Phase 1 (PRs) enforces an explicit contributor allowlist. Phase 3 (Issues) fetches all 200 open issues with no author filter. A spam issue or external security report would trigger Jira ticket creation in RHOAIENG under the Ambient team without any human triage. Fix: Add an author filter in the Phase 3 prompt instructions to mirror the Phase 1 contributor allowlist. External issues should not auto-generate Jira tickets without human triage. Minor Issues5. 60-minute timeout is excessive
Suggestion: Start with 6. Summary report behavior mismatch between PR description and prompt The PR description says "A GitHub issue is created summarizing all actions taken" but the actual prompt says "Print a summary report to the conversation." In Claude Code Action, conversation output goes to the Actions run log, not a GitHub issue. This is consistent with the recent commit Positive Highlights
Recommendations
Review generated by Claude Code against repository standards in 🔍 View AI decision process (logs available for 90 days) 📋 View memory system files loaded (click to expand)What Amber Loaded for Code ReviewAmber automatically loaded these repository standards from the memory system:
Impact: This review used your repository's specific code quality standards, security patterns, and best practices from the memory system (PRs #359, #360) - not just generic code review guidelines. |
Merge Readiness — Blockers Found
|
Jira: RHOAIENG-51880
Summary
Adds
jira-sync.yml— an agentic CI workflow that uses Claude Code to autonomously keep GitHub PRs, GitHub Issues, and Jira in two-way sync.Triggers: daily at 8 AM UTC (weekdays) +
workflow_dispatch+ PR lifecycle events (opened,ready_for_review,closed)What it does
Phase 1 — Open PR Health Check
stalelabel, skips further processingNew/Backlogand PR is open → transitions toIn ProgressPhase 2 — Merged PR Audit (last 7 days)
Resolved, adds merge commit as Jira commentPhase 3 — GitHub Issue Sync (all authors)
Phase 4 — Sprint Epic Alignment
customfield_10014Summary Report
A GitHub issue is created summarizing all actions taken and listing sprint outliers needing human triage.
Required secrets to add
JIRA_BASE_URLhttps://issues.redhat.comJIRA_USERNAMEJIRA_API_TOKENJIRA_BOARD_ID23005(or leave unset, defaults to 23005)CLAUDE_CODE_OAUTH_TOKENalready exists ✅Test plan
workflow_dispatchon a test branch🤖 Generated with Claude Code