---
name: multi-agent-jira
description: "List open Jira issues, pick one, and launch the multi-agent pipeline. Use when a Jira issue should be picked up and started without knowing its key in advance."
user-invocable: true
argument-hint: "[autopilot]  -  optional: run the pipeline without confirmations"
metadata:
  language: en
---

# multi-agent jira  -  Jira Issue Picker

**Input**: $ARGUMENTS

Interactively list the user's open Jira issues, let the user pick one, and send it to the pipeline.

**Access check, before anything else.** The pickers below can assign an issue and post a maturity comment before Phase 0 starts, so a refused person is stopped here, before the first question.

```bash
ACCESS_LINE=$(node "$HOME/.copilot/scripts/usage-access.mjs"); ACCESS_RC=$?
```

`ACCESS_RC` 3: print `$ACCESS_LINE` as written and stop: no picker, no assignee change, no comment, no state, attended or unattended. Any other exit continues (the check fails open). Contract: `$HOME/.claude/multi-agent-refs/features/usage-reporting.md` "The access check".

## Steps

1. **Jira credentials**  -  get the Jira token from the Keychain:
   ```bash
   JIRA_TOKEN=$(~/.copilot/lib/credential-store.sh get "Jira_Token")
   JIRA_HOST="{JIRA_HOST}"   # e.g. jira.example.com  -  from prefs.projects[{project}].jira.host
   ```

2. **Fetch the open issues**  -  via the Jira REST API:
   ```bash
   printf 'Authorization: Bearer %s\n' "$JIRA_TOKEN" | curl -s -H @- \
     "https://$JIRA_HOST/rest/api/2/search?jql=assignee=currentUser()+AND+status+not+in+(Done,Closed)&fields=key,summary,status"
   ```

3. **Let the user pick**  -  present the issues as options
   - Format: `PROJ-XXXXX  -  {summary} [{status}]`

4. **Create a branch**  -  for the selected issue:
   - Bug → `bugfix/PROJ-{id}`
   - Feature → `feature/PROJ-{id}`

5. **Start the pipeline**  -  run the `/multi-agent` command:
   - Input: `"PROJ-{id}" "branch-name"`
   - If the `autopilot` flag is present, in autopilot mode

## Maturity: the picked item may not be ready

The pipeline scores the item before anything is built. A blocker does not end the
run any more: an interactive run asks at that step (open the item and fix it,
continue without it - recording which gap was waved through - or abort), and an
autopilot run with `prefs.global.maturityFollowup.autopilotCommentsOnIssue` on
posts ONE comment on the item asking for what is missing, then stops and waits for
`resume`. Never a status change, never an assignee, never a close; `Ref:`, never a
closing keyword. Read the item's existing comments first and take the prior ask
from the newest one of ours - a scan is a new run with a fresh state file, so
state alone would make every scan a first ask. Full contract:
`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`.

