Jira
Install the Jira agent access integration and its MCP server so agents behind the P0 AI Gateway can request Jira tools in one space at a time.
The Jira agent access integration lets agents behind the P0 AI Gateway (see P0 Runtime Access for AI) request Jira tools in one space of your Jira Cloud site. You give P0 a pool of Atlassian service accounts. When a request is approved, P0 gives the agent session one account from the pool and adds it to a role in the space. The gateway then calls Atlassian's MCP server, https://mcp.atlassian.com/v2/mcp, as that account.
The integration runs on Google Cloud only. P0's connector runs on Cloud Run in your project, and every secret lives in Google Secret Manager.
Setup has these parts, in this order:
Prepare your Atlassian organization: the service accounts and their credentials.
Deploy the Jira connector in a Google Cloud project.
Register each Jira site.
Add the pool's agent accounts.
Add the Jira MCP server to your gateway.
Write the policies that decide which agents get which tools.
You can do steps 2 to 4 in the P0 app or with Terraform (see Install with Terraform). Step 5 uses Terraform. This page covers agent access only. To create Jira tickets for access requests, see Jira.
Prerequisites
In Atlassian:
A paid Jira plan. Free sites have no permission schemes or space roles.
Service accounts in your Atlassian organization, which needs centralized user management. Your plan limits how many you can create, which limits the size of your pool. See Understand service accounts.
No IP allowlist on the site. The beta doesn't support one, because the connector has no fixed IP address to add to it.
In Google Cloud and P0:
A registered Gateway component, with the gateway deployed in your environment. The gateway must reach
mcp.atlassian.comandsecretmanager.googleapis.com. See Network requirements.P0's Google Cloud IAM management installed for the project the connector runs in, with the Service Usage API turned on in that project.
Permission to apply Terraform in that project, from a machine that can reach Docker Hub.
The Google Secret Manager integration installed for the project that holds the site's secrets. This can be the connector's project or another one.
GCP Workload Identity Federation installed for that same secrets project, so that the gateway can read each agent's key.
Prepare your Atlassian organization
You create the service accounts and their credentials yourself, in Atlassian Administration. Atlassian shows a client secret or an API key only once, so store it as soon as you create it.
Create the admin service account that P0's connector uses, and use it for nothing else. See Manage your service accounts. Give it the User role on Jira and the Admin role on Jira Administration, which gives it the Administer Jira global permission. P0 checks this when you register a site.
Give the admin account an OAuth 2.0 credential. On the account, choose Create credentials, then OAuth 2.0. See Create OAuth 2.0 credential for service accounts. Select these scopes:
manage:jira-configurationmanage:jira-projectread:jira-userread:jira-work
Keep the client ID and the client secret.
Create the pool service accounts, one for each agent session that should use Jira on the site at once. Give each the User role on Jira, None on every other app, and add it to no groups. A group would give the account access outside P0's grants. A pool account may have Jira access on more than one site.
Give each pool account an API key. On the account, choose Create credentials, then API token, and select these scopes:
read:jira:agent-interfacewrite:jira:agent-interfacesearch:jira:agent-interface
Leave every
delete:andmanage:scope unselected. An API key lasts at most a year, so note when each one expires. To replace one, see Change the install later.Let the MCP server accept API keys. Under Connectors, Atlassian MCP server, Authentication, turn on API token. Atlassian notes that some MCP server tools may not be available with an API key, depending on its scopes. Agents can't request those.
You don't create any roles. In a company-managed space, P0 uses two site roles of its own:
P0 agent: read, with Browse projects.P0 agent: write, with Browse projects, Add comments, Edit own comments, Create work items, Edit work items, Transition work items, Resolve work items, Assign work items, Schedule work items, Link work items, Create attachments, Work on work items, and Edit own worklogs.
P0 creates both roles when it checks the site at install, and grants a role in a space's permission scheme the first time a request there needs it. If the site already has a role with one of these names that P0 didn't create for your P0 organization, the check fails. Ask a Jira admin to rename or delete that role under Settings, System, Project roles, then run the check again. P0 keeps both roles and their scheme grants after access ends. In a team-managed space, P0 uses one of the space's own roles, which the agent names in its request.
What an agent can see
A pool account sees what every Jira user on the site sees, as well as the space it's granted. At Jira's defaults, every user can browse company-managed spaces, and Open and Limited team-managed spaces. While an agent holds a grant, its approved tools can reach work items in those spaces too, not only in the space it requested. Private team-managed spaces, and spaces whose permission scheme doesn't let every user browse, stay closed until P0 adds the account to a role.
Deploy the Jira connector
Navigate to Integrations on p0.app, select Jira agent access, and choose the Jira connector component.
Click to add a connector, and enter an identifier for it. Use lowercase letters, digits, and hyphens, starting and ending with a letter or digit, up to 63 characters.
Fill in the connector details, then click Next:
GCP project ID: the Google Cloud project the connector runs in. P0 lists the projects where its Google Cloud IAM management is installed.
Connector name: the name of the connector's Cloud Run service, which is also the ID of the service account it runs as. Use 6 to 30 lowercase letters, digits, and hyphens, starting with a letter and ending with a letter or digit.
Connector region: the Google Cloud region the connector runs in, such as
us-west1.
P0 generates a Terraform configuration. Copy it into your Terraform project,
applyit, then click Next.The configuration creates:
A service account named after the connector. It gets no role in this project.
A Cloud Run service that runs P0's connector as that service account.
Bindings that let P0's Google Cloud service account, and no one else, invoke and read the service.
P0 checks that it can reach the connector. Review the summary and click Finish.
One connector can serve several Jira sites.
Register a Jira site
Store the admin service account's OAuth client secret in Google Secret Manager, in the secrets project. The secret's whole value is the client secret, with nothing else in it. Choose any secret name. For example, paste the client secret at the prompt.
read -skeeps it off the screen and out of your shell history:In P0, on the Jira agent access integration, choose the Jira site component and click to add a site.
Enter an identifier for the site, such as
acme. Agents, policies, and the CLI use this name. Use lowercase letters, digits, and hyphens, starting and ending with a letter or digit, up to 48 characters.Fill in the site details, then click Next:
Connector: the Jira connector that reaches this site.
Site URL: the address of your Jira Cloud site, as
https://<your-site>.atlassian.net, with no path.Secret manager provider: choose Google Secret Manager, then the installation for the secrets project.
Admin client ID: the client ID of the admin service account's OAuth credential.
Admin client secret name: the name of the secret from step 1. Enter the name alone, without its project or a version.
P0 looks up the site's Cloud ID for you.
P0 generates a Terraform configuration that grants the connector's service account access to the site's secrets. Apply it after the connector's Terraform, then click Next. P0 checks that the admin service account can sign in and holds Administer Jira. If the check fails right after you apply, wait a minute for the grants to take effect and click Next again.
A Jira site works with one P0 organization only: the first one to verify the site. Any other P0 organization gets an error at this check and on every grant there. If the first organization no longer uses the site, a Jira admin can free it by deleting
P0 agent: readandP0 agent: writeunder Settings, System, Project roles. Then verify the site from the other organization.Review the summary and click Finish. The site now appears with the state Installed.
What the site's grants allow
The site's Terraform grants the connector's service account these permissions in the secrets project, and nothing else. <site> is the site's identifier. In the custom role IDs, each hyphen in it becomes an underscore.
The admin client's secret
roles/secretmanager.secretAccessor and roles/secretmanager.viewer on that secret.
The site's agent account secrets, whose names start with p0_install_jira-ai_<site>_
roles/secretmanager.secretAccessor and roles/secretmanager.viewer on the project, with a condition on that prefix.
New secrets
The custom role p0JiraAi_<site>_create, with secretmanager.secrets.create on the whole project. Google checks this permission on the project, so a condition can't narrow it.
The site's request token secrets, whose names start with p0_access-token_jira-ai_<site>_
The custom role p0JiraAi_<site>_manage, with secretmanager.secrets.get, secretmanager.secrets.delete and secretmanager.versions.add, with a condition on that prefix.
The connector reads a secret's latest version and then that version's metadata, so it needs both the accessor role and the viewer role.
Add pool accounts
The number of agent accounts on a site is the number of agent sessions that can use Jira there at once.
In P0, on the Jira agent access integration, choose the Agent account component and click to add an account.
Enter an identifier for the account. Use lowercase letters, digits, and hyphens, starting and ending with a letter or digit, up to 63 characters.
Fill in the account details, then click Next:
Site: the installed Jira site this account works on.
Email: the service account's email, as Atlassian shows it.
P0 names the secret for the account's API key,
p0_install_jira-ai_<site>_<pool-account>_api-key, where<pool-account>is the agent account's identifier, and shows a command that creates it in the secrets project. Run it after you paste the service account's API key at aread -sprompt, which keeps the key out of your shell history:P0 never reads the secret. Only your connector does. Click Next.
P0 looks up the account's Atlassian account ID. Review the summary and click Finish.
Install with Terraform
Instead of the P0 app, you can install the connector, sites, and agent accounts with the P0 Terraform provider (see Manage integrations as code with the P0 Terraform provider), version 0.72.0 or later:
You still prepare Atlassian and store the admin client's secret, as described above. Each resource's page in the Terraform registry has a complete example, including the Google Cloud resources. Create the resources in this order:
Stage the connector with
p0_jira_ai_connector_staged. Setid, andhostingwithtype = "gcp",project_id,connector_nameandconnector_region. P0 answers withhosting.connector_service_account, the service account the connector must run as.Deploy the connector on Cloud Run, running as
hosting.connector_service_account, from the imagep0security/p0-connector-jira-ai-gcloud. Pin the image to the tag and digest in the Terraform that P0's installer shows. Give P0's Google Cloud service accountroles/run.invokerandroles/run.vieweron the service, and set the connector'sINVOKER_SA_EMAILenvironment variable to that service account's email. The connector refuses every call whileINVOKER_SA_EMAILis unset.Install the connector with
p0_jira_ai_connector, with the sameidandhostingas the staged resource. P0 checks that it can invoke the connector.Grant the connector access to the site's secrets, as listed in What the site's grants allow.
Add each site with
p0_jira_ai_site. Setid,connector,site_url,vault(type = "gcp-sm"andproject_id),admin_client_idandadmin_secret_name, and make it depend on the grants. P0 setscloud_id.Add each agent account with
p0_jira_ai_pool_account. Setid,siteandemail. P0 setsaccount_idandsecret_name. Store the account's API key in the secret thatsecret_namenames.
Keep client secrets and API keys out of Terraform. Create each secret's value with gcloud, as the registry examples do, so it never enters Terraform's state.
Add the Jira MCP server
You can add the Jira MCP server once at least one Jira site is installed. The server reads each grant's API key from your secret manager, and the P0 console doesn't offer that credential source, so add it with the p0_ai_gateway_server resource:
After you apply it, the server appears in P0 with the state Installed.
One Jira MCP server serves every site you install. Each request names the site it is for.
How agents request access
An agent requests access by naming the site by its P0 identifier, one or more Jira tools, and the key of a space with --project, such as ENG. The server must be a Jira (agent pool) server installed on the agent's gateway. Requests come only from agent sessions. Written as a CLI command, a request for two read tools in the ENG space on the acme site is:
The arguments are the gateway, the MCP server's identifier, the site, and then the tools.
To find spaces, boards, dashboards, filters and statuses, an agent can request these tools without --project: listJiraProjects, listJiraBoards, listJiraDashboards, listJiraFilters, listJiraStatuses, listJiraIssueLinkTypes and getJiraCurrentUser. P0 adds the account to no role for such a request, so the agent sees only what the account can already see on the site:
In a company-managed space, P0 picks the role from the tools: P0 agent: read when every tool only reads, or P0 agent: write when any tool can change data. In a team-managed space, the agent adds --role with the name of one of the space's roles, such as Member:
Approvers see the role before they approve, and your policies can allow or deny it. Supported tools lists every tool an agent can request.
A grant lasts at most 60 minutes and can't be extended. P0 refuses a longer request after approval, so agents request
--duration 1h, and approvers and policies allow at most 1 hour. When it ends, the agent requests again for more time.A grant covers one space, or, for the tools above, none.
An agent session holds one Jira grant at a time. Before it requests another, for more time or another space, it lets its grant expire or revokes it.
When every agent account on the site is in use, new requests fail until a grant ends.
Access can take a minute or two to start after a request is approved. When the request ends, P0 removes the account from the space's role and returns it to the pool. If that removal fails, P0 tries again before it gives the account to another session. If it keeps failing, P0 gives out that account only when no other is free, and that request fails and names the spaces the account is still in. To clear it, take the account out of those spaces' roles in Jira and revoke its API key in Atlassian. Then delete the agent account in P0, add it again under a new name, and store a new API key in the secret that P0 names for it.
See Requesting access for how agents submit and use requests.
Supported tools
These are the tools of Atlassian's Jira MCP server that an agent can request. A request that names only read tools gets P0 agent: read in a company-managed space, and one that names any write tool gets P0 agent: write.
Read tools
getJiraIssue
Gets a work item by key or ID.
searchJiraIssuesUsingJql
Searches work items with JQL.
listJiraIssueComments
Lists a work item's comments.
listJiraIssueWorklogs
Lists a work item's logged time.
listJiraIssueChangelogs
Lists a work item's field changes.
listJiraIssueTransitions
Lists the workflow transitions a work item can take.
listJiraIssueRemoteIssueLinks
Lists a work item's web links.
listJiraIssueAssignableUsers
Lists who can be assigned work in a space or on a work item.
downloadJiraIssueAttachment
Gets a short-lived download URL for an attachment.
getJiraEntityProperty
Reads a property stored on a work item, comment or worklog.
getJiraIssueTypeMetaWithFields
Gets the fields of a work type in a space.
listJiraProjectIssueTypesMetadata
Lists a space's work types.
listJiraProjectComponents
Lists a space's components.
getJiraProjectVersions
Lists a space's versions, or gets one.
getJiraProjectVersionRelatedWork
Lists the related work on a version.
getJiraBoardConfig
Gets a board's columns and filter.
getJiraBoardIssueData
Gets the work items on a board or its backlog.
getJiraBoardSprintData
Gets a board and its sprints.
listJiraBoardSprints
Lists a board's sprints.
listJiraProjects
Lists the spaces the account can see. No space needed.
listJiraBoards
Lists the boards the account can see. No space needed.
listJiraDashboards
Lists the dashboards the account can see. No space needed.
listJiraFilters
Lists saved filters. No space needed.
listJiraStatuses
Lists work item statuses. No space needed.
listJiraIssueLinkTypes
Lists the site's link types. No space needed.
getJiraCurrentUser
Gets the agent account's own profile. No space needed.
Write tools
createJiraIssue
Creates a work item.
editJiraIssue
Edits a work item's fields.
transitionJiraIssue
Moves a work item through its workflow, or into a sprint or the backlog.
addOrEditJiraIssueComment
Adds a comment, or edits one.
addOrEditJiraIssueWorklog
Logs time, or edits a worklog.
createJiraIssueLink
Links two work items.
createJiraIssueRemoteIssueLink
Adds a web link to a work item.
uploadAttachmentToJiraIssue
Attaches a file to a work item.
watchJiraIssue
Adds or removes the agent account as a watcher.
editJiraEntityProperty
Sets a property stored on a work item, comment or worklog.
manageJiraProjectVersionRelatedWork
Adds or updates related work on a version.
Not supported
Deleting work items, comments or attachments. Atlassian's delete tools need a scope that service accounts can't hold, so agent accounts can't use them.
manageJiraSprint, which can close sprints and change them irreversibly.manageJiraProjectVersion, which needs Jira's Administer Projects permission.convertJiraIssueHierarchy, which needs Jira's global Bulk change permission.createJiraBoard,getJiraUserandlookupJiraAccountId, which act beyond one space or look up users.Tools of other Atlassian apps, and tools that run other tools.
Write policies for Jira
Match Jira requests in an agentic access policy (see Agentic access policies) with service: jira-ai and accessType: tool. Four filters narrow them, each keyed on name:
site: the site's identifier in P0.project: the space key.tool: the Jira tool.role: the name of the role the grant gives. That'sP0 agent: readorP0 agent: writein a company-managed space, or the role the agent named with--rolein a team-managed space.
For example, auto-approve one read tool for one agent, but only in the ENG space on the acme site:
The maxDuration caps auto-approved grants at the 60 minutes Jira access allows. Without it, a request that names no duration gets your organization's default, which P0 refuses for Jira.
A rule that approves by site, space, or tool alone also approves any role an agent names in a team-managed space, including the space's Administrator role. To refuse that role to every agent, add a rule that denies it:
A deny rule wins over every other matching rule, whatever their order.
Change the install later
Rotate a pool account's API key. Create a new API key on the service account, with the same scopes, and add it as a new version of the account's existing secret. The secret's name stays the same. Grants made before the change keep the old key until they end, so wait an hour before you delete the old key in Atlassian. Rotate each key before it expires, since a key lasts at most a year.
Rotate the admin credential. Add the new client secret as a new version of the admin secret. A new client ID means a new site: delete the site and add it again.
Remove a pool account. Delete the agent account in P0, then delete its secret and the service account.
Grow the pool. Add more agent accounts.
Plan for many agents at once. Each open agent grant adds two IAM bindings to the secrets project's IAM policy. If many agents use Jira at the same time, use a secrets project dedicated to Jira.
Next steps
Define the Agentic access policies that determine which agents and users may request Jira access.
Last updated