JSM integration (integrations:jira-service-management)
integrations:jira-service-management
The Jira Service Management integration binds OpsChain's governed changes to the JSM requests they serve: requests and issues become typed references on governance metadata, request lifecycle writes flow through one audited door, inbound JSM webhooks ride the signed inbound lane as trigger sources, and a request resolved via OpsChain closes with the evidence links attached — the OpsChain ledger stays the source of truth, and what JSM receives is a copy with provenance.
The pieces
- JSM connection (
opschain admin jsm-connections): the per-site registration — an Atlassian cloud site or a Jira Data Center base URL, optionally scoped to named project keys (a write to a request outside them refuses by name). Authentication is cloud-style basic (account email + API token) or a Data Center personal access token sent as a bearer. The credential is held reference-first (api_token_ref, asecret-vault://address; the record never stores the token).testvalidates the record without calling JSM. - Typed references (
jsm/jirasystems,request/issuerecord types) on the governance metadata block every funnel subject carries — recorded withopschain approvals set-metadata, at run creation withopschain runs create … --ref, or by the resolution verb.opschain admin jsm-requests linksreads them back joined to their subjects, serving only subjects the caller may read. Therequire_change_referencepolicy lever counts them for Atlassian shops exactly as for any ITSM. - The outbound write door (
opschain admin jsm-requests): internal comments, workflow transitions, label/field writes and the evidence-linked resolution — every write entitlement-gated, project-scope checked, and recorded as aninfo:jsm:*event. The comment capability is internal notes only: the wire call hardwires the JSM internal flag and no verb on the surface carries a visibility parameter, so a customer-visible comment cannot be expressed through OpsChain — drafted replies stay internal until a human posts them as themselves. - Webhook ingestion (
opschain admin jsm-connections provision-webhook): one signed inbound-webhook connection on the generic inbound lane — Jira deliveries POST to/api/hooks/jsm-<code>, dedup on the verified signature, and execute (when a trigger matches) as the named service account. Request created/updated/commented events expose a normalised typed field set underevent.data.jira(key, project, status, summary, priority, labels, comment id and the internal-note flag) for trigger conditions; the raw payload stays underevent.data.payload. Jira Data Center signs natively (a webhook secret emitsX-Hub-Signature, sha256 HMAC — the lane honours only the sha256 shape, never sha1); an unsigned source must be fronted by a signer adding the genericX-OpsChain-Signature+ timestamp shape. - Evidence-linked resolution (
opschain admin jsm-requests resolve): one audited write that records thejsm:requesttyped reference (relationshipresolves) on the resolving change or workflow run's governance block, posts one internal evidence comment (provenance + evidence links), and performs the resolving transition.
Authority stays home
Visibility flows out; a quorum is never delegated. A JSM approval never satisfies an OpsChain approval checklist, and no run gate reads JSM state. The one place JSM's decision counts is a change record linked to a JSM change (below): the CAB decides the change in JSM, and the record moves to approved only when JSM has approved it and the approval policy holding the record, when one does, has released it — both must hold. The write door is the only JSM write path OpsChain offers, so any OpsChain-side agent or automation that touches JSM funnels through the same audited, capability-gated verbs.
The ITSM connector contract
One contract, stated once, joins an ITSM's change to an OpsChain change
record (opschain docs resources/change_record); the JSM connection is
its first implementation. The ITSM decides the request, OpsChain decides
the execution, and each side links to the other by id: the record carries
the change's id and page (external_approval, and a references entry
with record_type change), and every work note carries the record's
page.
Inbound (JSM → OpsChain), over the connection's provisioned, signed inbound webhook, when the connection declares a change mapping:
change.created— a Jiraissue_createddelivery for an issue the mapping treats as a change opens apendingrecord under the mapping's owner: title and description from the issue's summary and description, the class, window and scope from the mapped fields. An open record under the owner that already carries the change as a reference — systemjsm, record typechange, the change's id and its page on this connection (url) — is linked instead, but only when its scope sits inside the change's mapped scope and its class is the change's class; otherwise the link is refused by name, naming the record and what differs, and the record is left as it was.change.state— anissue_updateddelivery whose changelog moves the status moves the record by the mapping: toapproved(when the local half also holds — above), or toclosedwith the mapped verdict (cancelledincluded). A status that stays withinpendingis a note on the record and changes nothing — except on an approved record the ITSM had approved: moving its change back to a pending status (the CAB pulled it back) holds the record. It staysapproved, but no new run joins it — by scope,--changeor a retry, each refused by name "approval withdrawn by jsm (…)" — while the runs already under it continue; the ITSM's renewed approval releases it. A close while a run under an approved record still runs is kept as its pending close and applies, with the mapped verdict and a note naming the deferred close, when the last run under the record finishes; achanges closein the meantime supersedes it (opschain docs resources/change_record).change.window— anissue_updateddelivery whose changelog moves a mapped window field sets or moves the record's window.
A delivery for a change no record holds yet opens one, so an update that arrives before its creation is not lost. Every inbound move is a ledger row naming the ITSM's event id (the changelog id) and its own timestamp; a move stamped earlier than the last one applied is recorded and not applied, and a timestamp more than an hour ahead of the server's clock is recorded but never used to order moves. A window field set without its partner is refused by name, never read as a cleared window. A delivery whose event was already applied (Jira's retry) changes nothing.
The lane acts as the inbound connection's named service account
(provision-webhook --service-account) — never an ambient admin — with
the rights a person needs for the same move, decided on the record's
owner (/change_records for the root): update on <owner>/change_records
to open, link, move the window and close; update on
<owner>/change_records_approve to carry the ITSM's approval. The
account carries the ITSM's decision, never makes one, and the record's
approved_by / closed_by is that account's principal id. A denial is
answered not_found and recorded with the right that was missing. The
delivery's 202 answer names the record and each move's outcome, or the
refusal; every refusal is also a warn:change_record:inbound_refused
event. A failure that is not a refusal (the database, say) answers 503
and leaves the delivery unaccepted, so Jira's retry applies it. The
lane needs the integrations:jira-service-management entitlement and an
enabled connection, and the change must sit inside the connection's
project keys.
Outbound (OpsChain → JSM), through the write door, one event per write: a JSM internal note — never a customer-visible comment — on the linked change
- when each run under the record finishes: the run id, its outcome, its duration and the run's page;
- for each attested step and each break-glass act on the record: its evidence class and its link;
- when the record closes: the verdict, the close note and the coverage summary (runs, incidents — the runs that did not succeed —, attested steps, break-glass acts).
Notes carry run ids, outcomes and links — never a username, an email or a
secret. Each delivered note is one info:change_record:itsm_note event
(its comment id and length, never its text). Notes are queued in the
database and delivered by every server replica in turn (a claimed note is
leased, so two replicas never post the same one); a JSM that is
unreachable delays them — retried after 30 s, 2 m, 8 m and 30 m, five
attempts in all — and each failure is a warn:change_record:itsm_unreachable
event and a delivery_warning on the record (opschain changes show).
A run is never blocked by the ITSM. A note the write door refuses for
good — the connection deleted or disabled, or the change outside its
project keys — is dead-lettered at once with the reason; a lapsed
entitlement or a credential that does not resolve rides the same retry
ladder as an unreachable JSM.
The state mapping
A connection's change mapping (change_mapping on the connection —
opschain docs resources/jsm_connection; --change-mapping-file on
opschain admin jsm-connections create|update, which reads a file of at
most 64 KiB; the mapping itself holds at most 64 statuses and 256 scope
values of at most 64 patterns each) declares how its Jira
change requests map onto change records. It names every status a
change can be in and the one record state each projects onto —
pending, approved or closed, nothing else; OpsChain never learns the
ITSM's workflow — a verdict for each closing status, and the fields the
class, window and scope are read from:
owner_path: /projects/payments
link_base_url: https://opschain.example.com
states:
- {status: Planning, state: pending}
- {status: Awaiting CAB, state: pending}
- {status: Scheduled, state: approved}
- {status: Completed, state: closed, verdict: completed}
- {status: Failed, state: closed, verdict: rolled_back}
- {status: Declined, state: closed, verdict: cancelled}
class_field: customfield_10005 # Standard / Normal / Emergency
window_from_field: customfield_10010 # Planned start
window_to_field: customfield_10011 # Planned end
scope_field: customfield_10020 # the affected service
scopes:
- value: Payments gateway
scope: [/projects/payments/environments/prod/assets/gateway/**]
- value: Ledger
scope: [/projects/payments/environments/prod/assets/ledger]
issue_types: [Change]
The mapping is validated whole when the connection is created or updated
and refused by name — the field and why — when a status maps onto
anything but the three states, a closing status has no verdict, no status
approves or none closes, a status or value is declared twice, or a scope
sits outside the owner. A status JSM later sends that the mapping does not
declare, or a scope value it does not map, is refused by name on arrival
and recorded — never guessed. --clear-change-mapping removes the mapping;
the records it opened keep their link and stop receiving inbound moves.
Audit trail
Connection writes are audited as api:jsm_connections:* (the
api_token_ref pointer, never a value, and never the account email —
an auth_mode marker carries the shape — and whether a change_mapping
is declared). Every outbound write lands
one event: info:jsm:internal_comment (comment id and length — never
the note's content), info:jsm:transition, info:jsm:fields (field
names, never values) and info:jsm:resolution (the subject, the
request, the transition, the evidence links and the recorded
reference). Webhook provisioning lands
api:jsm_connections:provision_webhook. No event, response or error
ever carries token or signing-secret material.
Authorisation — per-verb rule paths
Every JSM procedure except the links read authorises as an updatable
determination on its own rule path under /admin:
| Rule path | Covers |
|---|---|
/admin/integrations/jsm/connections | connection CRUD, test, provision-webhook, connection reads |
/admin/integrations/jsm/requests/comment | the internal-note write |
/admin/integrations/jsm/requests/transition | request transitions |
/admin/integrations/jsm/requests/fields | label/field writes |
/admin/integrations/jsm/requests/resolve | the evidence-linked resolution |
Rule paths match as segment-boundary prefixes, so a plain /admin
updatable rule (the admin plane) covers the whole surface unchanged —
nothing changes for existing administrators. The deepened paths exist so
a principal can be granted exactly one verb: a support agent's
service account granted only the comment path can post internal notes
and nothing else, and a principal never granted the resolve path can
never resolve a ticket — "never resolves" as a grant shape, not agent
behaviour. The links read (admin jsm-requests links) stays per-row
node-path read pushdown with no admin gate.
Usage telemetry
Every request the integration makes is counted on the connection's
usage row (opschain docs provider-usage): api_calls with its latency
and api_errors (an unreachable site or a non-2xx answer), and on the
connection's provisioned inbound webhook webhooks_received and
signature_failures. opschain admin providers usage --kind jsm --code <code> reads them; the connection's record opens its operational
dashboard.
Entitlement
The server-side capability is gated on
integrations:jira-service-management (Enterprise-weighted; never
in the Basic-tier defaults). Expiry degrades politely, never
destructively: new registrations, enabling writes and every outbound
request write refuse with a named licence message, stored configuration
is retained untouched, deletion stays open, and everything lights back
up on upgrade.
Postures
- Local lane: there is no JSM connection; a local change record is never linked.
- Server on the SQLite store: the JSM integration and the inbound webhooks are refused by name ("inbound webhooks need the PostgreSQL store"), so no record is linked and no work note is written.
- Server on PostgreSQL: everything on this page.
Wiring it up
- Register the connection (
opschain admin jsm-connections create) with the site URL, auth and project scope;testit. - Provision webhook ingestion and configure the Jira webhook (issue
created/updated + comment created) with the signing secret shown at
provisioning; point a trigger at
external:webhook:receivedwithevent.data.jira.*conditions. - Bind changes to requests:
opschain approvals set-metadata <run> --ref jsm:request:SUP-123(orruns create … --ref). - Work the ticket through the door:
comment,transition,set-fields— and close it withresolve, evidence attached. - For change records, declare the change mapping
(
opschain admin jsm-connections update <code> --change-mapping-file mapping.yaml), make sure the provisioned service account holds update on the owner'schange_recordsandchange_records_approve, and set the base URL notes link to (link_base_url). The CAB's changes then open and move their records, and every run, attestation, break-glass act and close lands on the change as an internal note.
See also
opschain docs cli/admin-jsm-connections— the connection verbs.opschain docs cli/admin-jsm-requests— the write door and the links read.opschain docs change-governance— the governance metadata block.opschain docs resources/change_record— the record a change links to.opschain docs entitlements— the feature vocabulary.opschain docs triggers— inbound events as automation.