# Jira integration

Source: https://pinprompt.veren-technology.com/docs/reference/jira

Creates and links Jira issues from items, and keeps status and comments in step both ways. It is an event-log subscriber: turning it off changes nothing else, and a Jira status never moves the item (people sign off in pinprompt).

## One-time server setup (whoever runs pinprompt)

1. https://developer.atlassian.com/console/myapps/ → **Create → OAuth 2.0 integration**.
2. **Permissions → Jira API → Add**, then the scopes `read:jira-work`, `write:jira-work`, `read:jira-user`, `manage:jira-webhook` (pinprompt also asks for `offline_access`).
3. **Authorization → OAuth 2.0 (3LO)**: callback URL `<PINPROMPT_BASE_URL>/api/v1/integrations/jira/callback`.
4. **Settings**: copy the client ID and secret into `PINPROMPT_ATLASSIAN_CLIENT_ID` and `PINPROMPT_ATLASSIAN_CLIENT_SECRET`, redeploy. Until then the Jira card says what's missing.
5. To let people outside your Atlassian org connect, set the app's **Distribution** to *Sharing*.

## Per project

Owner or developer: **Settings → Integrations → Connect Jira**, sign in with Atlassian, pick the site, Jira project and issue type. Issues and comments from pinprompt appear as that person. pinprompt registers a webhook for that project (`<base>/api/hooks/jira/<integration id>`) and refreshes it before Jira's 30-day expiry; the card shows "one way only" if it couldn't.

## What it does

| pinprompt | Jira |
|---|---|
| *Create Jira issue* on an item (or, with the switch on, every agent-ready item) | Issue `[FB-12] Title` with the spec and a link back, label `pinprompt` |
| *Link* with a key or URL | Checked in Jira, then linked (one item per issue) |
| Spec revised | Summary and description updated |
| An agent takes it (With agent) | Moved to an In Progress status |
| Done / Won't fix / Merged | A comment, then a Done status (a Won't Do-like status for won't fix when there is one) |
| A person's or agent's comment | A comment "Name commented on FB-12 in pinprompt:" |

| Jira | pinprompt |
|---|---|
| Status change | The link shows the status, and a line "HAL-3 moved to In Review in Jira by Ana". Done in Jira says the item still waits for a check here. |
| Comment | On the item as "Ana Silva (Jira)", unless pinprompt posted it |
| Issue deleted | The link is marked deleted |

**What goes to the tracker.** The item's screenshots (up to three) go with the issue: on GitHub as images behind an unguessable signed link (`/api/v1/evidence/<id>/<sig>`, only item screenshots, gone when the evidence is removed, all revoked by rotating `PINPROMPT_SECRET_KEY`), on Jira as attachments. On an item a client reads, internal notes never go; a client's own comments go only with the card's **Client comments** switch on (off by default). On items no client reads, the team's comments go as before.

Webhook calls are verified by the JWT Jira signs with the app's client secret, replay-guarded, and only for the connected Jira project.
