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

# Jira Service Management

> Client-mode REST API connector for a curated Jira Service Management Cloud slice: customer requests from alarms, comments, status, and Assets CMDB object create

Technical Preview

## Overview

A client-mode connector for a **curated ITSM / OT** slice of the [Jira Service Management Cloud REST API](https://developer.atlassian.com/cloud/jira/service-desk/rest/intro/) under `https://YOUR_SITE.atlassian.net`, plus Assets object create on `https://api.atlassian.com`:

| Catalog connector event | Entity / path | Notes |
| - | - | - |
| (discovery / smoke) | `GET /rest/servicedeskapi/servicedesk` | List service desks |
| POST request (create from alarm) | `POST /rest/servicedeskapi/request` | Requires `serviceDeskId`, `requestTypeId`, `requestFieldValues` |
| POST request/\{id}/comment | `POST /rest/servicedeskapi/request/{issueIdOrKey}/comment` | Public or internal comment |
| GET request/\{id}/status | `GET /rest/servicedeskapi/request/{issueIdOrKey}/status` | Status history (current first) |
| (Assets discovery) | `GET /rest/servicedeskapi/assets/workspace` | Workspace IDs on site host |
| Assets POST object/create | `POST /jsm/assets/workspace/{workspaceId}/v1/object/create` | **Host:** `https://api.atlassian.com` — switch `BASE_ADDRESS` |

`BASE_ADDRESS` for Service Desk is `https://{site}.atlassian.net` (no trailing slash; endpoints already include `/rest/servicedeskapi/...`). Topics use `itsm/jira-sm/<object>/<verb>`.

> [!NOTE]
>
> Assets object create is **not** under `/rest/servicedeskapi/`. Official Cloud path is `https://api.atlassian.com/jsm/assets/workspace/{workspaceId}/v1/object/create`. Discover `workspaceId` via `GET /rest/servicedeskapi/assets/workspace` on the site. Prefer `/jsm/assets/` over deprecated `/jsm/insight/`.

> [!NOTE]
>
> Prefer Hub secrets for tokens and passwords. This template has not been verified against a live Atlassian site. Status remains blocked until an authenticated live smoke succeeds.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
# Coreflux REST_API template — Jira Service Management (Service Desk + Assets curated slice)
# Auth: Bearer {value.json.access_token} (OAuth 3LO) or Basic email + API token via config
# BASE_ADDRESS: https://YOUR_SITE.atlassian.net
# Assets create: set BASE_ADDRESS to https://api.atlassian.com

DEFINE ROUTE JiraServiceManagementRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://YOUR_SITE.atlassian.net"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '60'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Listservicedesks
        WITH SOURCE_TOPIC "itsm/jira-sm/servicedesk/list"
        WITH DESTINATION_TOPIC "itsm/jira-sm/servicedesk/list/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/rest/servicedeskapi/servicedesk"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Createrequest
        WITH SOURCE_TOPIC "itsm/jira-sm/request/create"
        WITH DESTINATION_TOPIC "itsm/jira-sm/request/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/rest/servicedeskapi/request"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    ADD EVENT Createrequestcomment
        WITH SOURCE_TOPIC "itsm/jira-sm/request/comment"
        WITH DESTINATION_TOPIC "itsm/jira-sm/request/comment/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/rest/servicedeskapi/request/{value.json.issueIdOrKey}/comment"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    ADD EVENT Getrequeststatus
        WITH SOURCE_TOPIC "itsm/jira-sm/request/status"
        WITH DESTINATION_TOPIC "itsm/jira-sm/request/status/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/rest/servicedeskapi/request/{value.json.issueIdOrKey}/status"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Getassetsworkspaces
        WITH SOURCE_TOPIC "itsm/jira-sm/assets/workspace"
        WITH DESTINATION_TOPIC "itsm/jira-sm/assets/workspace/response"
        WITH METHOD "GET"
        WITH ENDPOINT "/rest/servicedeskapi/assets/workspace"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Createassetsobject
        WITH SOURCE_TOPIC "itsm/jira-sm/assets/object/create"
        WITH DESTINATION_TOPIC "itsm/jira-sm/assets/object/create/response"
        WITH METHOD "POST"
        WITH ENDPOINT "/jsm/assets/workspace/{value.json.workspaceId}/v1/object/create"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
```

## Events

| Event | Method | Endpoint | Request topic | Response topic |
| - | - | - | - | - |
| Listservicedesks | GET | `/rest/servicedeskapi/servicedesk` | `itsm/jira-sm/servicedesk/list` | `itsm/jira-sm/servicedesk/list/response` |
| Createrequest | POST | `/rest/servicedeskapi/request` | `itsm/jira-sm/request/create` | `itsm/jira-sm/request/create/response` |
| Createrequestcomment | POST | `/rest/servicedeskapi/request/{issueIdOrKey}/comment` | `itsm/jira-sm/request/comment` | `itsm/jira-sm/request/comment/response` |
| Getrequeststatus | GET | `/rest/servicedeskapi/request/{issueIdOrKey}/status` | `itsm/jira-sm/request/status` | `itsm/jira-sm/request/status/response` |
| Getassetsworkspaces | GET | `/rest/servicedeskapi/assets/workspace` | `itsm/jira-sm/assets/workspace` | `itsm/jira-sm/assets/workspace/response` |
| Createassetsobject | POST | `/jsm/assets/workspace/{workspaceId}/v1/object/create` | `itsm/jira-sm/assets/object/create` | `itsm/jira-sm/assets/object/create/response` |

## Auth

**OAuth 2.0 (3LO) Bearer — default in the template:**

1. Create an OAuth 2.0 (3LO) app in the Atlassian Developer Console with Service Desk / Assets scopes as needed.
2. Obtain an `access_token`.
3. Set connector `BASE_ADDRESS` to `https://{site}.atlassian.net`.
4. Pass `access_token` on the MQTT request payload so headers resolve:
   * `Authorization: Bearer {value.json.access_token}`
5. Store the token in Hub secrets / `GET SECRET`. Never commit real credentials.

**Basic (email + API token):**

1. Create an [Atlassian API token](https://id.atlassian.com/manage-profile/security/api-tokens) for the integration account.
2. Prefer `WITH USERNAME "you@example.com"` and `WITH PASSWORD GET SECRET "ATLASSIAN_API_TOKEN"` on `REST_API_CONFIG` (remove Bearer header lines if using config Basic).

## Example payloads

**Create customer request from alarm:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "access_token": "YOUR_ACCESS_TOKEN",
  "serviceDeskId": "10",
  "requestTypeId": "25",
  "requestFieldValues": {
    "summary": "Line sensor fault — Zone A",
    "description": "Vibration above threshold at 2026-10-04T00:00:00Z"
  }
}
```

**Create comment:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "access_token": "YOUR_ACCESS_TOKEN",
  "issueIdOrKey": "HELPDESK-1",
  "body": "Coreflux alarm update: vibration still elevated.",
  "public": true
}
```

**Get request status:**

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "access_token": "YOUR_ACCESS_TOKEN",
  "issueIdOrKey": "HELPDESK-1"
}
```

**Create Assets object** (`BASE_ADDRESS` = `https://api.atlassian.com`):

```json theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
{
  "access_token": "YOUR_ACCESS_TOKEN",
  "workspaceId": "1060ba0e-178b-4e0e-g0h1-jedb02cccb5f",
  "objectTypeId": "250",
  "attributes": [
    {
      "objectTypeAttributeId": "2797",
      "objectAttributeValues": [{ "value": "PLC-Line-A" }]
    }
  ]
}
```

## Deploy notes

* Deploy **`JiraServiceManagementRestApi.lot` only** (`-addRoute`). Do **not** deploy `hub-metadata.lot` as a connector — it exists for Hub / `-listTemplates` (`ADD METADATA` + `WITH IMAGE` base64).
* Hub category: **REST API Connectors**.
* Doc link: [https://docs.coreflux.org/latest/lot-language/routes/rest-api-apps/jira-service-management](https://docs.coreflux.org/latest/lot-language/routes/rest-api-apps/jira-service-management)

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API Apps catalog](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.