> ## Documentation Index
> Fetch the complete documentation index at: https://docs.augmentcode.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate Jira Cloud

## Introduction

In this page we’ll learn how to configure 2 things:

* Get JIRA to push events to Augment Cosmos via webhooks

```mermaid theme={null}
sequenceDiagram
	autonumber
	participant J as Jira
	participant AC as Augment Cosmos

	J->>AC: Webhook: Issue Created (Ticket JSON)
	

```

* Get Augment Cosmos to interact with Jira via the Jira MCP server

```mermaid theme={null}
sequenceDiagram
	autonumber
	participant J as Jira
	participant AC as Augment Cosmos

	AC->>J: Read/Update Ticket via Jira MCP server
	J-->>AC: 200 OK (Sync Complete)
```

## Step 1 - Configure Jira to notify a Cosmos Webhook

Let’s create a new webhook in Cosmos (so Cosmos can listen to Jira events).
Prerequisites:

* Cosmos side: any user can self-create webhooks
* Jira Cloud side: any user (non-admin) can create automation-based webhooks as a "THEN" action. In this document we will not use legacy global Jira webhooks (only jira admins can create those)
  Configuration steps
* Go to Cosmos ([https://cosmos.augmentcode.com](https://cosmos.augmentcode.com)) > Settings > Capabilities > Webhooks > Create Webhook
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-01.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=9d620c09ecf08c9ec9ce88e97abfb0b4" alt="" width="828" height="1056" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-01.png" />
* That gives us a url to POST with a given Bearer token to pass as HTTP header. Curl request would look like:

```shell theme={null}
curl -X POST https://XXX.api.augmentcode.com/webhooks/XXX \
  -H "Authorization: Bearer XXX" \
  -H "Content-Type: application/json" \
  -d '{"event": "test", "data": "your payload here"}'
```

**Create a new webhook config in Jira** (so Jira can POST to a given url when certain Jira events occur)

* Go to your Jira env ([https://augmentcode-demo.atlassian.net/jira/](https://augmentcode-demo.atlassian.net/jira/))
* Wheel icon > System
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-02.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=79b3282ce61721953facee0d663119ed" alt="" width="785" height="357" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-02.png" />
* Left nav bar > Automation > Global automation
* Top right: Create rule > Create from scratch
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-03.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=b215d7693dc8d4fa0249e94a628cb0d8" alt="" width="397" height="163" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-03.png" />
* On the “Add a trigger” view, add trigger “Work item created”:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-04.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=18705e2c9808f81acb6685e7e469b65f" alt="" width="828" height="303" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-04.png" />
* Click on add component under the When block:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-05.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=43642ff07486bf18b3250b70281a31c4" alt="" width="747" height="363" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-05.png" />
* Click on “THEN: Add an action”, search “Send web request”:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-06.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=a2a5ab1a8ef6c00d5046ad15868655c4" alt="" width="641" height="626" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-06.png" />
* Add
  * Web request URL: the Augment webhook url
  * Keep HTTP method to POST
  * Web request body: select Issue data (Automation format)
  * Headers, add:
    * Authorization: Bearer \<augment-webhook-secret>
    * Content-Type: application/json
      <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-07.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=c85a3c316a9327f6c735d35929c350d9" alt="" width="347" height="485" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-07.png" />
* Then click on rule details and add
  * Name
  * Keep scope: Global
  * Keep owner: yourself
  * Keep Actor: Automation for Jira
* Click on turn on rule
  Now create a new Jira ticket.
  Then go back to Cosmos and check that Cosmos received the event:
* Settings > Automations > Event Log. You should see your event with source “Custom”
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-08.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=ffcdd7698b9de4ea45bf5164f5833128" alt="" width="961" height="240" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-08.png" />
* Click on the event:
  * Verify it contains details about the Jira ticket you just created:
    <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-09.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=5cd4d48d312a42c2390f4120aad98600" alt="" width="554" height="739" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-09.png" />
    At this point Jira can invoke Cosmos ✅.

## Step 2 - Integrate with Jira using your own identity

### Prerequisites

Your Atlassian organization admin must authorize access from [https://cosmos.augmentcode.com/mcp/callback](https://cosmos.augmentcode.com/mcp/callback) to your Atlassian space

### Configure the native Atlassian integration via MCP server

We’ll leverage the native Atlassian MCP Server integration:

* Go to Cosmos [https://cosmos.augmentcode.com](https://cosmos.augmentcode.com) > Settings > Capabilities > MCP Registry
* Search for Atlassian > click on “+” > My Identity (OAuth):
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-10.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=0cfbea539e24b24b15ef0ad4342bb443" alt="" width="902" height="374" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-10.png" />
* Make sure Jira and Confluence are selected, click on approve
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-11.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=38e0e6f9bfc835d49e6cb37d6faf37f6" alt="" width="1220" height="1254" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-11.png" />
* Select your Atlassian space, review the scopes/permissions and click on Accept:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-12.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=3a2fa39be797cfe86b6a9574ee8b34af" alt="" width="1126" height="2038" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-12.png" />
* Toggle on “Cosmos Agent” and optionally “CLI”, then click on Close:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-13.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=6c65a5ab1b0d1ee97bad24c9a993608f" alt="" width="634" height="652" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-13.png" />

### Run a test

* Open a new session ([https://cosmos.augmentcode.com](https://cosmos.augmentcode.com)) > New session
* In the prompt, click on the Atlassian icon > MCPs > make sure Atlassian is toggled on:
  <img src="https://mintcdn.com/augment-mtje7p526w/TwcxA1duL_U0xuBp/images/cosmos-integrations/jira-cloud/jira-cloud-14.png?fit=max&auto=format&n=TwcxA1duL_U0xuBp&q=85&s=c0da463adeec29af94a88be4ed10bd4f" alt="" width="1194" height="1040" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-14.png" />
* Now prompt Cosmos to look up a given ticket by its url:
* Verify that Cosmos was able to look up the ticket:
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-15.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=41d15e0cd6e1f88c0bbf713f3cad9206" alt="" width="988" height="1298" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-15.png" />
  Congrats, now you can create a Cosmos expert that listens to the corresponding webhook and post to Jira/Confluence on your behalf 🚀

## **Bonus: Integrate with Jira via a Service Account (recommended for headless automation)**

### **Create a Jira Service Account**

For Cosmos to interact with Jira via a Jira service account we’ll leverage the Atlassian remote mcp server and authenticate it with said service account as we’d want Cosmos to run headless automations.
Let’s create a dedicated Jira service account and its access token:
As a Atlassian admin go to:

* [https://admin.atlassian.com/](https://admin.atlassian.com/)
* Directory > Service Account > Create a Service account
  * Enter the name “Augment Code”
  * Select app “Jira” with role “User”
  * Save
* On that newly created Service account > click on Create credentials
* Choose authentication type “API token”
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-16.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=f4438bb0f63658094210afd2a8a92cb7" alt="" width="443" height="329" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-16.png" />
* Next
* Pick a name and expiration date (max 1 year out)
* Select those scopes (look them up using the search bar):

```plain text theme={null}
Read
read:jira-work
read:jira-user
read:comment:jira
read:comment.property:jira

Manage (optional)
manage:servicedesk-customer
manage:jira-webhook
manage:jira-project
manage:jira-data-provider
manage:jira-configuration

Write
write:jira-work
write:comment:jira
write:comment.property:jira
write:request.comment:jira-service-management
```

* Next, then Create
* Copy the API token

### Configure the Atlassian MCP server

Now let’s configure the Atlassian MCP server with that service account’s access token in Cosmos:

* Go to Settings > MCP Registry ([https://cosmos.augmentcode.com/mcp](https://cosmos.augmentcode.com/mcp))
* If you had an existing Atlassian MCP server configured with your human identity, delete it.
* Search for Atlassian > click on “+” > Service Account (API Token):
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-17.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=7cf2cd9007a40d6813bac29fe4726f29" alt="" width="888" height="354" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-17.png" />
* API token: paste YOUR\_ATLASSIAN\_SERVICE\_ACCOUNT\_API\_TOKEN
* Keep enabled products CLI and Cosmos Agent selected
* Visibility: switch to shared to make that MCP server + service account reusable by other users
* Click on Save
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-18.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=e9d3c2e4e4c236170e6eb42ed36f29e1" alt="" width="768" height="1022" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-18.png" />
  Note: when you save this configuration, the value of the Authorization header is stored securely in Cosmos’ secret manager. If you go to Cosmos ([https://cosmos.augmentcode.com](https://cosmos.augmentcode.com)) > Settings > Capabilities > Secrets it will look like:
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-19.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=b7e4117666c2e51162caa3d8c6289539" alt="" width="918" height="102" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-19.png" />
  In your MCP registry you should now see your MCP server.

### Run a test

Let’s now create a session to test the connectivity:

* Left nav bar > + New session
* Make sure the “Atlassian MCP server - service account” is attached to the session and that the native Atlassian integration is disabled
* Prompt: lookup a given Jira ticket via its url
* Send
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-20.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=07c4600d4ad2ade861d27ad4de85de89" alt="" width="722" height="205" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-20.png" />
* Then prompt the agent to add a hello world comment onto the ticket
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-21.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=9a627d2d26b088fd4c581c3fff37ba06" alt="" width="1742" height="1796" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-21.png" />
  Verify that your Jira ticket has been updated:
  <img src="https://mintcdn.com/augment-mtje7p526w/ws3FkwddjnEOseab/images/cosmos-integrations/jira-cloud/jira-cloud-22.png?fit=max&auto=format&n=ws3FkwddjnEOseab&q=85&s=41db3911672c1b8b5b46a78814c68fde" alt="" width="326" height="611" data-path="images/cosmos-integrations/jira-cloud/jira-cloud-22.png" />
  Congrats, now you can create a Cosmos expert that listens to the corresponding webhook, and leverage that Atlassian MCP server for full headless automation 🚀
