Skip to content

Jira

Connect Jira so that tickets assigned to Crios become working sessions, progress flows back into Jira as comments from a bot account, and agents can work with Jira issues during a session.

Jira has two parts:

  • Your organization's Jira connector: a service account, its API token and a webhook. An organization owner or admin configures it under Organization → Connectors → App credentials → Jira.
  • Members' Jira accounts, connected from the Jira card on the Apps tab of the personal Connectors page and signed in with Atlassian. A project can map itself to Jira projects on one of these accounts; see Jira projects.

Setting up the organization's connector

Create a Jira service account for Crios and generate an API token for it. Atlassian recommends a token with scopes; for Crios, pick the Jira scopes read:jira-work, write:jira-work and read:jira-user. A token without scopes works too. Then click Configure on the Jira card and fill in:

Field Description
Host Your Jira site, for example your-org.atlassian.net (https:// is added when you leave it out). An API token with scopes works only through Atlassian's API gateway: then the Host is https://api.atlassian.com/ex/jira/<cloud id>, which Test Connection detects for you
Email The service account's email address
API token The service account's API token
Webhook secret Shared secret the Jira webhook signs its deliveries with
Bot account ID The Atlassian account ID of the service account
Project ID The key (ENG) or numeric ID of the Jira project the agent's Jira tool works in; the numeric ID is under Project settings → Details in Jira. Tickets the webhook captures go to the Crios project their Jira project is mapped to. A Crios project's ID here instead sends every ticket the connector captures to that project, and the agent's Jira tool then works only in projects with a Jira project mapping

Click Save & Apply, then Test Connection. The test signs in as the service account, reports its name and email, and offers the detected Bot account ID with a Use button. The card's Setup guide lists the steps in Jira's console.

If your site refuses the token and Atlassian's API gateway accepts it, as it does a token created with scopes, the test fails and says so. It offers the gateway address of your site, https://api.atlassian.com/ex/jira/<cloud id>, as the detected Host: click Use, then Save & Apply. Crios finds the cloud id in your site's public /_edge/tenant_info page.

The Host must be a public https address: Crios never connects to a host that resolves to a private or internal address. A failed test names what Jira answered (a 401 means Jira refused the email and API token), or says that no Jira site could be reached at that host.

The API token belongs to the Host and Email it was saved with. Change either, and the card asks for the token again: Test Connection waits until you type it, and Save & Apply without it clears the saved token. Crios never sends a saved token to a site you have only typed in.

The card's Webhook URL is your organization's own receiver, https://<crios-host>/api/v1/webhooks/jira/<organization-id>. In Jira, go to Settings → System → WebHooks, create a webhook that sends issue created, issue updated and comment events to that address, and give it the same secret as Webhook secret. Limit it with a JQL filter such as project = ENG to the projects Crios works on; without one, Jira sends the tickets of every project. Crios checks every delivery's HMAC signature against the secret and rejects anything that does not match. Until a secret is saved, it answers 503. The address without an organization, /api/v1/webhooks/jira, still works while your organization is the only one whose webhook secret validates the delivery. When another organization's secret matches too, Crios cannot tell whose it is and answers 409, so use your organization's own address.

Public URL required

Jira Cloud must be able to reach your Crios API for webhooks to arrive.

Triggers

Crios picks up a Jira issue when any of the following happens:

Trigger How it works
Assignment Assign the issue to the Crios service account (the Bot account ID)
Label Create the issue with the crios-eligible label
Project mapping Create the issue in a Jira project that is mapped to a Crios project (see below)
Mention Mention the bot in a comment: @crios, or an @-mention of the service account

Captured issues become external intake tickets and dispatch into sessions automatically. Events caused by the service account itself are ignored, so Crios's own comments never start new work.

Mapping Jira projects for intake

A mapping routes the issues of one Jira project, by its key (for example ENG), to a Crios project. Issues created there become tickets without anyone assigning or labeling them. A mapping can narrow that to certain issue types or to issues carrying one label. Mappings are managed by organization owners and admins through the API, and there is no screen for them:

curl -X POST "https://api.example.com/api/v1/organizations/$ORG_ID/integrations/jira/mappings" \
  -H "Authorization: Bearer crios_pat_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"project_id": "'$PROJECT_ID'", "jira_project_key": "ENG",
       "acceptedIssueTypes": ["Bug"], "labelFilter": "crios"}'

The key is stored upper-case, as Jira writes it in issue keys, so eng maps ENG-12; a second mapping of the same key in the same project answers 409. GET on the same path lists the organization's mappings, each with its jira_project_key, and DELETE …/mappings/{mappingID} removes one (404 when no such mapping belongs to your organization). A mapping also decides which Crios project a ticket from that Jira project lands in, whatever triggered it. Without a mapping, Crios reuses the project of your organization's most recent earlier ticket from the same Jira project (the same key prefix, such as ENG-), or leaves the ticket in Needs Project. Add a mapping for every Jira project you work in.

Steering from comments

While a session is working on an issue, comment on the issue to reach it:

  • /crios focus <guidance> steers the session, for example /crios focus prioritize the API change, skip the UI polish. See steering.
  • /crios work <details> and /crios fix <details> send the command and your details to the session as a message.

A comment must start with /crios. On an issue Crios has not captured yet, these commands do nothing; mention the bot instead.

Status write-back

As the ticket moves through its lifecycle, Crios comments on the Jira issue as the bot account: when work starts, when a pull request is ready, and when work completes or fails. Each status is written once, so issues do not fill up with duplicates. If your deployment configures Jira transition IDs (CRIOS_JIRA_TRANSITION_WORKING, CRIOS_JIRA_TRANSITION_PR_READY, CRIOS_JIRA_TRANSITION_DONE, CRIOS_JIRA_TRANSITION_FAILED), Crios also moves the issue through those workflow transitions.

Jira access during sessions

Agents can also work with Jira as part of a session: searching issues, reading details, creating issues, commenting, assigning, and transitioning status. Issue descriptions and comments an agent writes end with a footer naming the Crios user it acted for (— Name (email) via Crios). Calls go through the Crios server, which holds the credentials and allows each organization one Jira call every two seconds, with bursts of up to 10.

Anyone who can edit a Jira project can write its issues, so what the agent reads from Jira (search results, an issue's details, its transitions) reaches it marked as content written by other people, to be treated as data and never followed as instructions. This holds whichever account the agent uses.

Which account the agent uses depends on the project:

  • A project with a Jira mapping on its Connectors tab works through the mapped member's Jira account (see below).
  • Any other project uses the organization's service account and the Jira project in its Project ID, and only that project: an action on one issue (reading, commenting, assigning, transitioning) is refused for an issue of any other Jira project. When Project ID holds a Crios project's ID instead, such a project has no Jira access until it gets a Jira project mapping.

Note

Jira credentials never enter the session sandbox. The agent only sees the results of the calls, not your API token.

Jira projects

On a project's Connectors tab, the Jira projects section maps the Crios project to one or more Jira project keys on a member's connected Jira account. Pick the account from Choose a Jira account…, enter the Jira project's key, such as ENG (a letter, then letters, digits or underscores), and click Add mapping. You can map only your own account, and adding a mapping also links that account to the project. From then on, the agent's Jira tool in every session of that project runs through the mapped account, as the member who mapped it, in that Jira project only. With several mappings, the tool uses the newest; removing it brings back the one before. Mapping your account therefore lends its Jira access to the project's sessions; the footer on descriptions and comments still names the Crios user each call was made for. To stop it, remove the mapping, or unlink or disable the account on the project's Connectors tab. With no Jira account connected yet, the section says Connect a Jira account on the Connectors page first.

Through a member's account, the account's access level applies: at Read, the agent can list projects, search and read issues, but not create, update, assign, comment on or transition them. Assigning also needs Atlassian's user-lookup permission (read:jira-user), which Crios does not ask for by default. The member adds it from the account's Permissions: with the assign action ticked, click Save and request 1. See Access and permissions.

When Jira stops accepting the mapped account, for example after its member removed Crios's access in Atlassian, the account's state on the member's Connectors page becomes Reconnect, and the agent's Jira tool stops with Jira's answer and the advice to reconnect the account. Until the member reconnects it, the tool does not switch to the organization's service account.

A personal Jira account needs the organization's Jira app to carry an OAuth client. An organization owner or admin enters it on the Jira card under App credentials, in OAuth client ID (member accounts) and OAuth client secret (member accounts). Create the client in the Atlassian developer console (developer.atlassian.com → My apps → Create → OAuth 2.0 integration): under Permissions, add the Jira API with the scopes read:jira-work, write:jira-work and read:jira-user (Crios asks for offline_access itself); under Authorization, set the callback URL to https://<crios-host>/api/v1/integrations/oauth/callback, which the card's Setup guide shows ready to copy. A deployment that shares its Jira app as the Crios app fills them for an organization that has saved neither. Without either app, connecting fails with Jira is not configured for your organization (missing OAuth app credentials), and the Jira card on members' Apps tab shows Needs setup unless the organization's own Jira connector is configured; with only the connector, its sheet says Signing in with your own Jira account isn't set up for this organization. Organization owners and admins can review every project's Jira mappings under Organization → Connectors → Hub overview.

Once the organization's connector names a Jira project in Project ID, members see it on their Connectors page as your organization's connection, a Service account. It reads Error while Jira refuses the service account's credentials.