Jira Service Management Integration

Jira Service Management Integration

Connect Jira Service Management Cloud to TR-AI: agent API token, the two automation rules (Send web request), the triage queue, and how public and internal comments work.

Note:Jira Service Management Cloud only. Two automation rules send new requests and comments to TR-AI; TR-AI replies through the service desk API as the agent account whose API token you enter.

What TR-AI does on a request

SituationWhat TR-AI does in Jira
Confident answer (auto mode)Adds a public comment (Reply to customer), then transitions the request into a Done-category status (Resolve / Done)
Draft (assisted mode or medium confidence)Adds an internal comment with the draft and queues it in your TR-AI dashboard for one-click approval
Can't answerAdds an internal comment with what it found, optionally an acknowledgement, and the label tr-ai-triage
Customer commentsAnswers new public comments from the reporter or participants — unless the request is assigned or an agent has replied
Internal comments, TR-AI's own commentsIgnored

Step 1 — Prepare an agent account and API token

  1. 1
    Pick the account
    Use an Atlassian account with an agent licence on the service project (a dedicated account like tr-ai@yourcompany.com makes TR-AI's comments easy to spot).
  2. 2
    Create an API token
    Signed in as that account, go to id.atlassian.com → Security → Create and manage API tokens and create a token.
  3. 3
    Find the service desk ID
    Open the customer portal; the number in /servicedesk/customer/portal/<id> is the service desk ID.

Step 2 — Enter the credentials in TR-AI

Choose Jira Service Management at sign-up (or Update credentials on the dashboard's setup card) and enter the site URL (https://acme.atlassian.net), the account email, the API token and the service desk ID. TR-AI checks the token and that the account can see the service desk before saving.

Step 3 — Add the two automation rules

In the service project open Project settings → Automation → Create rule. Your dashboard shows the exact URL (with its secret key) to use in both rules.

  1. 1
    Rule 1 — new requests
    Trigger Work item created. Action Send web request: URL = your TR-AI web request URL, method POST, header Content-Type: application/json, Web request body = Custom data with the body below. Name it, turn it on.
  2. 2
    Rule 2 — comments
    Trigger Work item commented. Optionally add the condition Comment visibility = public. Same Send web request action with the second body below.
  3. 3
    Rule actor
    Leave the rule actor as Automation for Jira. TR-AI's own comments reach Rule 2 too — TR-AI recognises them by author and ignores them.
Rule 1 — Work item created: custom data
{
  "event": "created",
  "issueKey": "{{issue.key}}",
  "issueId": "{{issue.id}}",
  "summary": "{{issue.summary.jsonEncode}}",
  "description": "{{issue.description.jsonEncode}}",
  "reporterName": "{{issue.reporter.displayName.jsonEncode}}",
  "reporterEmail": "{{issue.reporter.emailAddress}}",
  "reporterAccountId": "{{issue.reporter.accountId}}"
}
Rule 2 — Work item commented: custom data
{
  "event": "comment",
  "issueKey": "{{issue.key}}",
  "issueId": "{{issue.id}}",
  "summary": "{{issue.summary.jsonEncode}}",
  "description": "{{issue.description.jsonEncode}}",
  "reporterName": "{{issue.reporter.displayName.jsonEncode}}",
  "reporterEmail": "{{issue.reporter.emailAddress}}",
  "reporterAccountId": "{{issue.reporter.accountId}}",
  "commentId": "{{comment.id}}",
  "commentBody": "{{comment.body.jsonEncode}}",
  "commentAuthorAccountId": "{{comment.author.accountId}}",
  "commentInternal": "{{comment.internal}}"
}
Warning:Keep the ?key= part of the URL — requests without it are rejected.

Step 4 — Create the triage queue

Requests TR-AI can't answer get the label tr-ai-triage. In Queues → New queue create "TR-AI triage" with JQL labels = tr-ai-triage AND statusCategory != Done.

Step 5 — Import history and go live

  • TR-AI imports resolved requests from the selected window. The answer is the last public comment by an agent; internal comments are stored as internal context only and never quoted to customers.
  • New accounts start in assisted mode: drafts appear as internal comments and in the dashboard for approval.
  • Approving a draft posts it as a public comment and transitions the request; rejecting adds the triage label.

How the resolve transition is chosen

Workflows differ, so TR-AI reads GET /rest/api/3/issue/<key>/transitions and picks a transition into a status in the Done category, preferring names containing "Resolve", then "Done", then "Close" — never Cancel, Decline or Won't do. If the transition screen requires a resolution, it uses Done / Fixed / Resolved. If no such transition exists from the current status, the comment is still posted and the request is left in its status.

Troubleshooting

SymptomCheck
401 on saveEmail and API token belong to the same Atlassian account
"Service desk not found"The ID is the portal number, and the account is an agent on that project
Nothing arrives at TR-AIRule audit log in Project settings → Automation; the URL includes ?key=
Follow-ups not answeredThe comment must be public and from the reporter or a participant; assigned requests are left to the assignee