Integrations
How-to

Connect Jira

Connect an Agent to Jira Cloud with a scoped or non-scoped API token and the minimum required project permissions.

For
Jira administrators, Agent operators, and Organization administrators
On this page
  1. Connection model
  2. Before you begin
  3. Credential fields
  4. Choose an authentication type
  5. Cloud ID resolution
  6. Plan Jira permissions
  7. 1. Create the API token
  8. 2. Prepare the Jira account
  9. 3. Connect Jira
  10. 4. Validate the credential
  11. 5. Verify access
  12. Runtime behavior
  13. 6. Rotate the token
  14. 7. Remove Jira access
  15. API reference
  16. Troubleshooting
  17. Recommended practices
  18. Next steps
  • Integrations
  • 10–15 minutes
  • Requires a Jira Cloud API token

Connect Jira to let an Agent search issues, inspect projects and boards, work with sprints, and — when permitted — create, update, transition, or comment on issues.

Agent Barn stores the Jira API token as an encrypted Agent Secret, and creates an aai-cli profile named jira-work when the Agent starts.

Connection model

  1. Atlassian account
  2. API token
  3. Encrypted Agent Secret
  4. jira-work profile
  5. Jira Cloud

The credential authenticates the Agent. The Jira Skill supplies the aai-cli workflows the Agent uses against that credential.

Before you begin

You need:

  • A Jira Cloud site
  • An Atlassian account with Jira product access
  • Permission to create an API token
  • The Jira site URL
  • The email address associated with the token
  • Access to configure the Agent
  • agent.update and agent.secret.manage permissions
  • Lifecycle permission when connecting a running Agent

Decide whether the Agent needs read-only project access, issue creation, issue updates and transitions, comments, or board and sprint management.

Use a dedicated Atlassian account or service identity when possible.

Understand the credential fields

Field Purpose
Site URLIdentifies the Jira Cloud tenant
Authentication typeSelects scoped or non-scoped token routing
EmailAtlassian account associated with the token
API tokenAuthenticates the account
Cloud IDResolved and stored internally for scoped tokens

Use the base site URL:

Site URL
https://example.atlassian.net

Do not enter a Jira route or REST path:

Not accepted
https://example.atlassian.net/jira

https://example.atlassian.net/rest/api/3

Agent Barn builds the required API paths.

Choose an authentication type

Agent Barn supports two Jira token paths. Both use Basic authentication with the account email and API token — the difference is the API host.

Non-scoped token

Standard Atlassian account API token, sent directly to your Jira site.

Runtime route
https://example.atlassian.net/rest/api/3/...

Choose this when the token is intended for direct Jira site API access.

Scoped token

Sent through Atlassian’s API Gateway using the resolved Cloud ID.

Runtime route
https://api.atlassian.com/ex/jira/{cloud_id}/rest/api/3/...

Choose this when the token must be sent through Atlassian’s API Gateway.

How Cloud ID resolution works

For a scoped token, Agent Barn requests tenant metadata from the site and stores the returned Cloud ID with the encrypted credential.

  1. Jira site URL The base tenant URL saved with the credential
  2. /_edge/tenant_info Agent Barn requests the site’s tenant metadata
  3. Atlassian Cloud ID Stored with the encrypted credential
  4. api.atlassian.com/ex/jira/{cloud_id} The gateway host used by scoped tokens at runtime

Cloud ID lookup occurs when the credential is saved, and again during live validation when required.

Plan Jira permissions

Grant permissions based on the intended workflow.

Agent workflow Common Jira permission requirement
List or read issuesBrowse Projects
View boards and sprintsBrowse Projects, and access to the underlying project
Create issuesCreate Issues
Update issue fieldsEdit Issues
Add commentsAdd Comments
Transition issuesTransition Issues
Assign issuesAssign Issues
Create or manage sprintsManage Sprints
Add issues to sprintsManage Sprints, and the appropriate issue permissions

The exact Jira permission scheme can vary by project. Start with Browse Projects, then add narrowly scoped permissions for documented write workflows.

Create the Jira API token

Using the intended Atlassian account:

  1. Open the account’s security settings.
  2. Go to API token management.
  3. Create the appropriate token type.
  4. Give it a descriptive name, such as Agent Barn — Support Agent.
  5. Set an expiration or rotation plan when available.
  6. Copy the token.
  7. Record whether it is scoped or non-scoped.

Prepare the Jira account

Before connecting:

  1. Confirm that the account can sign in to the Jira site.
  2. Confirm that it has Jira product access.
  3. Open each intended project.
  4. Verify the project permissions required by the Agent.
  5. Remove access to unrelated projects where possible.
  6. Test one read-only Jira action with the account.

The API token inherits the account’s effective Jira access.

Connect Jira in Agent Barn

  1. Stop the Agent, or begin the web interface’s restart-aware edit flow.
  2. Open the Agent.
  3. Go to Configuration.
  4. Select Keys & integrations.
  5. Select Edit.
  6. Add Jira under Integration credentials.
  7. Choose Enter credentials.
  8. Enter the base Jira site URL.
  9. Select Scoped token or Non-scoped token.
  10. Enter the Atlassian account email.
  11. Paste the API token.
  12. Apply the configuration.
  13. Restart the Agent if it was running.
  14. Validate the credential.
  15. Test project and issue access.

The API token is hidden after it is saved.

Use a Shared Jira Credential

Jira is supported by Organization Shared Credentials. To attach one:

  1. Open the Agent’s integration configuration.
  2. Select Jira.
  3. Choose Use shared credential.
  4. Select the named Jira credential.
  5. Apply the configuration.
  6. Restart the Agent.
  7. Validate and test the connection.

Assign the Jira Skill

The credential provides authentication. The Jira Skill provides the Agent with detailed aai-cli workflows.

If the active Template requires Jira:

  1. Open the Agent’s Skills configuration.
  2. Confirm that the Jira Skill is assigned.
  3. Confirm the pinned Skill version.
  4. Save the Agent configuration.
  5. Start the Agent.

An explicit Template requirement must be satisfied by an explicit Skill assignment.

Validate the credential

  1. Open Keys & integrations.
  2. Find Jira.
  3. Select Validate.
  4. Confirm the expected account identity.
  5. Resolve any errors.
  6. Continue with project-level verification.

For a non-scoped token, Agent Barn requests /rest/api/3/myself on your site. For a scoped token, it requests the same path through the Atlassian gateway host.

Validation confirms that the site is reachable, the email and token authenticate, the account has Jira product access, the Jira account is active, and the expected identity is returned.

Response
{
  "validation_status": "valid",
  "validation_identity": "Support Agent ([email protected])",
  "validation_error": null,
  "missing_scopes": []
}

Verify access

Verify project access

Ask the Agent:

Agent request
List the Jira projects available to the connected account.

The underlying command is:

Shell
aai-cli jira projects list --limit 20 --profile jira-work

Review the result for missing intended projects, unexpected projects, or incorrect account scope. If unexpected projects appear, reduce the Atlassian account’s Jira permissions.

Verify issue access

Use a known project key:

Shell
aai-cli jira issues list \
  --project SUPPORT \
  --limit 10 \
  --profile jira-work

Jira issue listing requires at least one filter. Do not run an unbounded issue query. Other useful filters include:

Filters
--status "To Do,In Progress"
--assignee me
--sprint current
--updated-since 7d

Read a known non-sensitive issue:

Shell
aai-cli jira issues get SUPPORT-123 --profile jira-work

Confirm that the returned issue belongs to an intended project, and that sensitive fields follow organizational policy.

Verify boards and sprints

Shell
aai-cli jira boards list \
  --project SUPPORT \
  --limit 10 \
  --profile jira-work
Shell
aai-cli jira sprints list \
  --board 42 \
  --state active \
  --profile jira-work

Board visibility depends on the connected account’s access to the underlying Jira projects.

Verify write access safely

Only test writes when the Agent is intended to perform them. Use a designated test project or issue.

Shell
aai-cli jira issues comments create SUPPORT-123 \
  --body "Agent Barn integration verification." \
  --profile jira-work
Shell
aai-cli jira issues create \
  --project SUPPORT \
  --summary "Agent Barn integration verification" \
  --description "Temporary test issue." \
  --profile jira-work

Remove or close test data after verification.

Runtime behavior

When the Agent starts, Agent Barn:

  1. Decrypts the Jira credential.
  2. Resolves the scoped-token Cloud ID when needed.
  3. Stores the API token in the runtime secret store.
  4. Creates the jira-work profile.
  5. Mounts eligible Jira Skill instructions.
  6. Adds the Jira site and connected email to the integration context.

For a non-scoped token:

Generated profile
[profiles.jira-work]
auth_type = "basic_api_token"
site_url = "https://example.atlassian.net"
email = "[email protected]"
api_token_secret = "jira.api_token"

For a scoped token, the profile uses the Atlassian gateway host with the resolved Cloud ID.

Scoped-token save behavior

When a scoped credential is saved, Agent Barn tries to resolve and store its Cloud ID.

If lookup temporarily fails, the encrypted credential can still be stored without the Cloud ID, but runtime profile generation skips the Jira profile until the credential is saved again successfully. Always validate a scoped credential after saving it.

If validation reports a Cloud ID error:

  1. Confirm the site URL.
  2. Confirm that Agent Barn can reach the site.
  3. Save the credential again.
  4. Validate it.
  5. Restart the Agent.

Rotate the Jira token

  1. Create a replacement token in Atlassian.
  2. Record whether it is scoped or non-scoped.
  3. Stop the Agent, or begin a restart-aware edit.
  4. Open Keys & integrations.
  5. Enter the complete replacement Jira credential.
  6. Re-enter the site URL, authentication type, and email.
  7. Apply and restart.
  8. Validate the new token.
  9. Test project and issue access.
  10. Revoke the old token.

Stored credential values cannot be retrieved or partially edited.

Change the Jira account

  1. Prepare an API token for the replacement Atlassian account.
  2. Confirm its product and project permissions.
  3. Replace the complete Jira credential in Agent Barn.
  4. Apply and restart.
  5. Validate the returned identity.
  6. Test intended projects.
  7. Revoke the previous account’s token when appropriate.

Review project access carefully, because the new account may have a different permission scheme.

Remove Jira access

  1. Stop the Agent, or begin a restart-aware edit.
  2. Identify any assigned Skill requiring jira.
  3. Remove or replace that Skill when permitted.
  4. Open Keys & integrations.
  5. Select Remove for Jira.
  6. Apply the configuration.
  7. Restart the Agent.
  8. Confirm that Jira is unavailable.
  9. Revoke the API token in Atlassian.

Agent Barn rejects removal while a remaining assigned Skill requires Jira.

API reference

Add a non-scoped Jira credential

The Agent must be stopped.

HTTP
PATCH /api/v1/organizations/{organization_id}/agents/{agent_id}
Content-Type: application/json
Request body
{
  "secrets": [
    {
      "provider": "jira",
      "content": {
        "site_url": "https://example.atlassian.net",
        "use_scoped_token": false,
        "email": "[email protected]",
        "api_token": "REDACTED"
      }
    }
  ]
}

Add a scoped Jira credential

Request body
{
  "secrets": [
    {
      "provider": "jira",
      "content": {
        "site_url": "https://example.atlassian.net",
        "use_scoped_token": true,
        "email": "[email protected]",
        "api_token": "REDACTED"
      }
    }
  ]
}

Do not submit cloud_id. Agent Barn resolves and enriches that field internally. Every token value in these examples is redacted — supply your own.

Attach a Shared Jira Credential

Request body
{
  "shared_credentials": [
    {
      "shared_credential_id": "3fd08cf5-59c5-494b-9449-a0413109a0ca"
    }
  ]
}

Validate Jira

HTTP
POST /api/v1/organizations/{organization_id}/agents/{agent_id}/integrations/jira/validate

Validation requires agent.secret.manage.

Remove Jira

Request body
{
  "removed_secret_providers": [
    "jira"
  ]
}

Troubleshooting

Validation says “Invalid email or API token”

Check the pair and the token type

Check that:

  • The email belongs to the token’s Atlassian account
  • The token was copied completely
  • The correct authentication type was selected
  • The token has not expired or been revoked
  • The site URL belongs to the intended Atlassian tenant

Replace the complete credential and retry.

Validation says the account has no Jira product access

Product access is separate

The Atlassian account exists but does not have Jira product access for the site.

Grant the appropriate product access, or use another account.

Validation says the Jira account is inactive

Reactivate or replace the account

Reactivate the Atlassian account, or connect an active account.

Agent Barn cannot resolve the Cloud ID

Check the base site URL

Confirm that the base site URL is correct and reachable:

Site URL
https://example.atlassian.net

Do not include a Jira route or REST API path. Save and validate the scoped credential again.

The runtime logs say cloud_id missing

Saved before discovery succeeded

The scoped credential was saved when Cloud ID discovery failed.

Re-enter the complete credential, save it again, validate it, and restart the Agent.

Validation passes, but no projects appear

Identity is not project access

Identity validation does not check project permissions.

Grant Browse Projects for the intended projects, and verify that project security settings permit the account.

One project works and another returns 404

Per-project permission schemes

The connected account likely lacks Browse Projects or issue security access in the second project.

Review that project’s permission scheme.

Issue listing returns an unbounded-query error

At least one filter is required

Provide at least one filter, such as:

Filters
--status "To Do,In Progress"
--assignee me
--sprint current
--updated-since 7d

Issue reads work, but comments fail

Add Comments is separate

The account probably lacks Add Comments in that project.

Grant the permission only if the Agent should comment.

Issue reads work, but transitions fail

Permission or workflow state

The account may lack Transition Issues, or the requested transition may not be valid from the issue’s current workflow state.

Boards or sprints are missing

Board access follows project access

Confirm access to the underlying software project and board. Sprint modification additionally requires Manage Sprints.

A Shared Credential conflicts with a manual Jira credential

One source per provider

An Agent can use only one Jira credential source.

Remove the manual credential before attaching the Shared Credential, or replace the Shared attachment with a manual credential.

Jira was connected but the Agent cannot use it

Restart, Skill, profile, or permissions

Check that:

  • The Agent restarted after saving
  • The Jira Skill is assigned when required
  • The expected Skill version is pinned
  • The jira-work profile was generated
  • Validation returns the expected identity
  • The Atlassian account has project access
  • Startup logs do not report a missing Cloud ID
  • Use a dedicated Atlassian identity for production Agents
  • Grant Jira product access only where required
  • Restrict the account to intended projects
  • Begin with Browse Projects
  • Add write permissions one workflow at a time
  • Use separate credentials for Agents with different project boundaries
  • Select the correct scoped-token setting
  • Validate every scoped credential
  • Test reads before writes
  • Use a designated project for write verification
  • Rotate tokens on a documented schedule
  • Revoke old and unused tokens
  • Never place Jira tokens in Templates, Skills, prompts, or conversations
  • Review Jira permission schemes when an Agent’s responsibilities change

Next steps

Continue to Connect Confluence to configure an Atlassian credential for the intended Confluence spaces and page operations.

Documentation