Skip to content

๐Ÿค– Jira Agent Onboarding Guide

This guide walks you through setting up the jira-agent periodic Prow job for your OpenShift team. The jira-agent automatically picks up Jira issues, solves them using Claude Code, runs code review, addresses findings, creates PRs, and sends Slack notifications.

๐Ÿ“ฆ Generic Step Registry

The Jira Agent is implemented as a generic, parameterized step registry in openshift/release at ci-operator/step-registry/jira-agent/. Any team can reuse it by creating a thin wrapper workflow with their own env vars and credentials. No bash scripting required.

For the full setup guide โ€” workflow templates, periodic job config, credentials, environment variables, and credential overrides โ€” see the step registry ONBOARDING.md.


โš™ How It Works

flowchart LR A["๐Ÿ” Jira Query"] --> B["๐Ÿ› ๏ธ Solve"] B --> C["๐Ÿ‘€ Review"] C --> D["โœ… Fix"] D --> E["๐Ÿš€ Create PR"] E --> F["๐Ÿ’ฌ Slack Notify"] E --> G["๐Ÿ“Š HTML Report"]

The jira-agent runs as a periodic Prow job with three phases:

Phase What happens
โœ… Setup Verifies Claude Code CLI and Vertex AI credentials
๐Ÿ›  Process For each Jira issue: solve โžก review โžก fix โžก PR creation
๐Ÿ“Š Report Generates an HTML report with token usage, cost breakdown, and phase output

Your team creates a thin workflow YAML that sets team-specific env vars and references the generic step registry components.


๐Ÿ“‹ Prerequisites

Checklist

  • [x] GitHub App installed on both your fork org and upstream repo
  • [x] ๐Ÿด Fork organization on GitHub where the agent pushes branches
  • [x] ๐Ÿ” Vault secret synced to OpenShift CI
  • [x] โ˜ Vertex AI access via a Google Cloud service account
  • [x] ๐Ÿท Jira labels on issues you want the agent to process (e.g., issue-for-agent)
  • [ ] ๐Ÿ“ฃ (Optional) Slack incoming webhook for PR notifications

๐Ÿด Fork / Upstream Model

The jira-agent pushes branches to a fork and creates PRs against the upstream repo. This is the same fork-based workflow developers use โ€” it avoids needing write access to the upstream repo.

flowchart LR A["๐Ÿค– Jira Agent"] -->|push branch| B["๐Ÿด Fork Repo"] B -->|create PR| C["๐Ÿ  Upstream Repo"] C -->|review & merge| D["๐ŸŽ‰ Merged!"]

HyperShift Team Example

Repo Purpose
๐Ÿ  Upstream openshift/hypershift PRs are created against this repo
๐Ÿด Fork hypershift-community/hypershift Agent pushes branches here

Tip

For teams working on repos within the openshift/ GitHub org, create a fork organization (e.g., my-team-bots/my-repo) and install the GitHub App on both. The agent only needs push access to the fork; PR creation to upstream is handled by the GitHub App's permissions.


๐Ÿš€ Setup Steps

Follow the step registry ONBOARDING.md for the complete setup instructions:

  1. Create your wrapper workflow โ€” a thin YAML file referencing the generic step refs with your team's env vars
  2. Create the periodic job config โ€” add the job to your CI config in openshift/release
  3. Set up credentials โ€” store GitHub App, Jira, and Vertex AI credentials in a Vault secret
  4. Submit a PR to openshift/release

๐Ÿงช Rehearsal Testing

To test your job in a PR, trigger a rehearsal with the full job name:

/pj-rehearse periodic-ci-openshift-<your-repo>-main-periodic-jira-agent

โš  Never run bare /pj-rehearse โ€” always specify the full job name.


Jira Setup

๐Ÿท Labels

The agent uses labels to track which issues have been processed:

Label Who adds it Purpose
issue-for-agent ๐Ÿ‘ค You Marks issues for the agent to pick up
agent-processed ๐Ÿค– Agent Prevents re-processing on subsequent runs

Your JQL query should include labels = issue-for-agent AND labels != agent-processed to implement this pattern.

๐Ÿ”’ Security Level

Warning

Make sure your Jira issues are accessible to the service account. If issues have restricted security levels, the agent's API token must have access to that level. Issues with security levels the agent can't see will silently be excluded from JQL results.

โœ Issue Format

For best results, structure Jira issue descriptions with these sections:

  • Context โ€” Background information about the problem
  • Acceptance criteria โ€” Clear criteria for what the fix should accomplish
  • Steps to reproduce โ€” For bugs, numbered reproduction steps
  • Expected vs actual behavior โ€” What should happen vs what happens

Validate issues with /jira:ready-to-solve

The /jira:ready-to-solve skill validates that an issue's description is well-groomed enough for the agent to produce a quality solution. It checks for required sections (Context, Acceptance Criteria, Technical Details), runs AI qualitative assessments, and can auto-fix failing checks with --fix. Run it before labeling issues for the agent:

/jira:ready-to-solve OCPBUGS-12345        # validate
/jira:ready-to-solve OCPBUGS-12345 --fix  # validate and fix

Issues that pass are labeled ready-to-solve; those that fail get not-ready-to-solve.

Example Issue Description
## Context
The FooController does not handle the case where the bar field is nil,
causing a nil pointer dereference when reconciling resources created
before v4.15.

## Acceptance Criteria
- The controller handles nil bar field gracefully
- Existing resources without the bar field continue to work
- Unit tests cover the nil case

## Steps to Reproduce
1. Create a Foo resource without the bar field
2. Wait for reconciliation
3. Observe panic in controller logs

๐Ÿ” JQL Examples

project = OCPBUGS
  AND labels = issue-for-agent
  AND labels != agent-processed
project = OCPBUGS AND resolution = Unresolved
  AND status in (New, "To Do")
  AND labels = issue-for-agent
  AND labels != agent-processed
project in (OCPBUGS, CNTRLPLANE) AND resolution = Unresolved
  AND status in (New, "To Do")
  AND labels = issue-for-agent
  AND labels != agent-processed
project = OCPBUGS AND priority in (High, Highest)
  AND labels = issue-for-agent
  AND labels != agent-processed

HyperShift Team

The HyperShift team uses this JQL to find agent-eligible bugs:

project in (OCPBUGS, CNTRLPLANE)
  AND resolution = Unresolved
  AND status in (New, "To Do")
  AND labels = issue-for-agent
  AND labels = ready-to-solve
  AND labels != agent-processed

Note the labels = ready-to-solve filter โ€” only issues validated by /jira:ready-to-solve are picked up.


๐Ÿšจ Troubleshooting

\"No issues found\"
  • ๐Ÿ” Check that your JQL query returns results in the Jira UI
  • ๐Ÿ” Verify the Jira API token has access to the project and security level
  • ๐Ÿท Ensure issues have the issue-for-agent label (or whatever your JQL filters for)
\"Required credentials are missing\"
  • ๐Ÿ“ฆ Verify your Vault secret is synced to the CI namespace
  • ๐Ÿ”‘ Check that the key names in your secret match JIRA_AGENT_FORK_INSTALLATION_ID_KEY and JIRA_AGENT_UPSTREAM_INSTALLATION_ID_KEY
  • โœ… Required keys: app-id, private-key, fork installation ID, upstream installation ID
\"Failed to generate GitHub App token\"
  • Verify the GitHub App is installed on the target org/repo
  • ๐Ÿ†” Check that the installation ID is correct (not the app ID)
  • ๐Ÿ”‘ Ensure the private key matches the app
Plugin installation fails
  • The process script forces HTTPS for git operations:
    git config --global url."https://github.com/".insteadOf "git@github.com:"
    
  • โš  If you see SSH-related errors, check that this config is applied before plugin installs
PR creation fails
  • ๐Ÿ›ก Verify the GitHub App has Pull requests: Read & write permission on the upstream repo
  • ๐Ÿ”„ Check that the fork is synced with upstream (the agent does this automatically)
  • ๐Ÿšซ Ensure the branch name doesn't conflict with an existing branch
Slack notification not sent
  • ๐Ÿ”— Verify slack-webhook-url in the Vault secret is a valid incoming webhook URL
  • ๐Ÿ“„ Check job logs for webhook response errors

โญ Reference Implementation

See the HyperShift team's implementation for a complete working example:

Resource Link
๐Ÿ“– Step registry onboarding guide ONBOARDING.md
๐Ÿ“„ Wrapper workflow hypershift-jira-agent-workflow.yaml
โฐ Periodic job config openshift-hypershift-main.yaml
๐Ÿ“ฆ Generic steps ci-operator/step-registry/jira-agent/
๐Ÿ“š HyperShift CI docs AI-Assisted CI Jobs