Skip to content

feat(adapters): Jira task-management adapter — talk to Archon inside a ticket#1752

Draft
coleam00 wants to merge 6 commits into
devfrom
feat/jira-adapter
Draft

feat(adapters): Jira task-management adapter — talk to Archon inside a ticket#1752
coleam00 wants to merge 6 commits into
devfrom
feat/jira-adapter

Conversation

@coleam00

Copy link
Copy Markdown
Owner

Summary

Adds a Jira adapter in a new task-management adapter category (sibling to chat/ and forge/), so each Jira issue becomes a live Archon conversation: @mention the bot in a comment, it runs through the orchestrator and replies back as a comment on the same ticket. Many tickets = many parallel conversations, the same way Slack threads work.

This is a conversation point, not an end-to-end auto-resolver — the adapter only routes the conversation (webhook in → handleMessage → comment back). Actually resolving a ticket (explore → implement → PR → transition) stays a workflow concern, with a future jira skill for status transitions.

Closes #1750.

What it adds

  • packages/adapters/src/community/task-management/jira/adapter.ts (JiraAdapter), auth.ts, types.ts, index.ts, adapter.test.ts
  • community/task-management/README.md — category conventions
  • /webhooks/jira route + env-gated init in packages/server/src/index.ts
  • Export from packages/adapters/src/index.ts; example env-template entry

Key design decisions

  • New task-management category — Jira is a work tracker, not a chat platform or a code forge. It borrows chat-style conversation semantics (conversation = issue key; no repo/clone/worktree) and forge-style webhook transport.
  • Bot identity is a display-name string (JIRA_BOT_MENTION, optional, defaults to Archon, case-insensitive) — no Jira accountId required. Mention detection matches a real ADF mention node or plain @name text.
  • Self-trigger guard appends an invisible zero-width marker to the bot's own comments (the bot posts via the same account it reads from, so an author-based guard can't work).
  • Auth: Basic auth (email + API token); the webhook is verified by a shared secret passed as ?secret= (Jira doesn't HMAC-sign its webhooks).
  • Optional allowlist for which users may trigger the bot.

Validated live (end-to-end)

Tested against a real Jira site + ticket: an @Archon comment → webhook → mention detected → orchestrator reply posted back to the ticket; a follow-up message worked too; no self-trigger loop. The live run surfaced and fixed several real payload-shape issues:

  • Site is read from JIRA_DOMAIN (accepts a bare domain or a full URL).
  • Jira's comment webhook delivers the comment body as a plain string, not ADF — handled in both hasMention and extractTextFromAdf.
  • The webhook's issue.fields is partial — issue-context building is now defensive.
  • Account email + credential are trimmed to avoid whitespace-related Basic-auth failures.

Test plan

  • type-check (all packages), lint --max-warnings 0, format:check clean
  • Adapter unit tests pass
  • Manual end-to-end against a live Jira ticket (mention → reply round-trip)
  • Reviewer: confirm the new task-management category placement + README
  • Follow-up: companion jira workflow skill (status transitions) + docs-web page

🤖 Generated with Claude Code

coleam00 and others added 4 commits May 23, 2026 10:10
Add JiraAdapter implementing IPlatformAdapter for Jira Cloud webhooks.
Receives comment_created events, detects @mentions via ADF tree walking,
posts replies as ADF comments with Basic auth. Includes webhook secret
verification, accountId allowlist, self-trigger guard, and 25 unit tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add null guard on commentEvent.issue?.key before dereferencing (plan risk mitigation)
- Remove dead optional chain on non-nullable secret parameter
- Skip empty trailing lines in buildAdfDocument to avoid malformed ADF text nodes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arker-based self-trigger guard

- Bot detection now matches by display name (case-insensitive) via ADF mention
  attrs.text/attrs.displayName or plain text @name patterns
- JIRA_BOT_MENTION is now optional (defaults to 'Archon'); removed from required env gate
- Self-trigger guard replaced: outgoing comments embed U+200B x3 marker; incoming
  webhooks containing the marker are skipped before JSON parsing
- extractTextFromAdf strips the marker so it never reaches the model
- Updated adapter.test.ts: 28 tests covering name-based detection (case-insensitive),
  Archon default, text-node @mention, and marker self-trigger guard; no botAccountId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ields, JIRA_DOMAIN)

Found while testing the adapter end-to-end against a live Jira instance:

- Read the Atlassian site from JIRA_DOMAIN; accept a bare domain or a full URL (scheme auto-added).
- Jira comment webhooks deliver the comment body as a plain string, not ADF -- hasMention and extractTextFromAdf now handle both string and ADF node bodies.
- The webhook issue-fields payload is partial (labels/status/priority/summary may be absent) -- build the issue context defensively.
- Trim the account email and API credential so stray whitespace cannot break Basic auth.
- Document the new variable in the example env template.

Verified live: an @archon comment on a Jira ticket is detected and answered with a reply posted back; the zero-width self-trigger marker prevents loops.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ddbb86ae-014e-422d-b588-eeb721bd7da5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/jira-adapter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coleam00 and others added 2 commits May 23, 2026 13:47
- New community adapter page documenting the conversation-point model,
  API-token auth, ?secret= webhook config, env vars, conversation-id format,
  and troubleshooting (from the live end-to-end test).
- Listed Jira in the Community Adapters table and the "choosing an adapter" list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The server already reports Jira in activePlatforms, but the Settings page
hardcoded the adapter list and omitted it — every other adapter (incl. the
community ones) was listed. Add the Jira row for parity.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Wirasm

Wirasm commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@$coleam00 related to #1348 — overlapping area or partial fix.

@Wirasm

Wirasm commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@$coleam00 related to #1469 — overlapping area or partial fix.

@Wirasm

Wirasm commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@$coleam00 related to #1348 — overlapping area or partial fix.

@Wirasm

Wirasm commented May 27, 2026

Copy link
Copy Markdown
Collaborator

@$coleam00 related to #1469 — overlapping area or partial fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Jira platform adapter: talk to Archon inside each ticket (conversation point, not end-to-end resolver)

2 participants