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.
What TR-AI does on a request
| Situation | What 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 answer | Adds an internal comment with what it found, optionally an acknowledgement, and the label tr-ai-triage |
| Customer comments | Answers new public comments from the reporter or participants — unless the request is assigned or an agent has replied |
| Internal comments, TR-AI's own comments | Ignored |
Step 1 — Prepare an agent account and API token
- 1Pick the accountUse an Atlassian account with an agent licence on the service project (a dedicated account like
tr-ai@yourcompany.commakes TR-AI's comments easy to spot). - 2Create an API tokenSigned in as that account, go to id.atlassian.com → Security → Create and manage API tokens and create a token.
- 3Find the service desk IDOpen 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.
- 1Rule 1 — new requestsTrigger Work item created. Action Send web request: URL = your TR-AI web request URL, method
POST, headerContent-Type: application/json, Web request body = Custom data with the body below. Name it, turn it on. - 2Rule 2 — commentsTrigger Work item commented. Optionally add the condition Comment visibility = public. Same Send web request action with the second body below.
- 3Rule actorLeave 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.
{
"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}}"
}{
"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}}"
}?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
| Symptom | Check |
|---|---|
| 401 on save | Email 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-AI | Rule audit log in Project settings → Automation; the URL includes ?key= |
| Follow-ups not answered | The comment must be public and from the reporter or a participant; assigned requests are left to the assignee |