--- id: "2611b1f4-504a-4093-beae-a85e2b43745a" name: "Jira REST Audit Pattern" micro_summary: "Authenticated Jira audit recipe (browser-harness + JQL + post-filter)" status: "in_progress" see_also: [{"target": "49498e21-7f1e-4b2b-94fc-dcea7936f786", "reason": "Usage example and runnable snippet (browser-harness -c)"}] scope: "How to perform read-only authenticated Jira audits via browser-harness. Steps: reuse authenticated tab, verify /myself, query /rest/api/3/search/jql, collect fields, paginate, post-filter by assignee displayName, parse ADF descriptions to short actionable summaries, and persist artifacts." --- ## Steps 1. `list_tabs()` -> find a target with `the Jira host` in the URL. If found, `switch_tab(targetId)` to reuse auth. 2. Verify identity: `GET /rest/api/3/myself` -> confirm `displayName`. 3. Run JQL via `/rest/api/3/search/jql` with `maxResults=100` and a `fields=` list. Example JQLs used: - `assignee = currentUser() AND statusCategory != Done ORDER BY priority DESC, updated DESC` - `assignee = currentUser() ORDER BY updated DESC` 4. Loop with `nextPageToken`/`isLast` until exhausted (guard max pages). 5. Post-filter results: keep only issues where `fields.assignee.displayName === ` to avoid stale accountId mismatches. 6. For each issue: extract key, summary, status.name, status.statusCategory.name, priority.name, assignee.displayName, updated, issue URL (`/browse/`), parent/epic if present, and small actionable summary from description or last comment (ADF -> text). 7. Save raw JSON and a normalized audit JSON + markdown summary to disk for handoff. ## Notes - Always treat this as read-only. Do not mutate issues, transitions, or comments in audit runs. - Use a small Python helper file executed via stdin (see Runtime Invocation) to avoid js() quote/async pitfalls when calling fetch repeatedly.