Support agent
Replies on the Zendesk ticket, comments on the open Jira bug and escalates in Slack.
A local Jira Cloud REST API for your agent’s tests. Issues, comments and transitions it makes stay in the project, so a test can check what it filed and where it commented.
Open bugs
CSV export returns an empty file · Rachel Moore
SSO login loops on Safari
Acme Support commented on OPS-2
Zendesk #4101, Ridgeway Robotics: Monthly CSV export is empty.
Erin Walsh’s monthly CSV export is empty, and Zendesk ticket #4101 says so. Engineering already has the bug: OPS-2, In Progress with Rachel Moore. The agent was told to comment on an open bug or file one. It searched for bugs in To Do, found none, and filed a second one.
The test checks the agent’s calls to Jira: it must search, must not create an issue, and must comment on OPS-2. Changing one line in the agent makes all three pass, with the test unchanged.
| Check | Original agent | Fixed agent |
|---|---|---|
| Searched for the bug | 3 of 3 | 3 of 3 |
| Filed no duplicate | 0 of 3 | 3 of 3 |
| Commented on OPS-2 | 0 of 3 | 3 of 3 |
Scripted agent, no model. Recorded with CLI 0.4.74.
- const jql = 'project = OPS AND status = "To Do" AND text ~ "CSV export"';+ const jql = 'project = OPS AND statusCategory != Done AND text ~ "CSV export"';Save agent.mjs and scene.yaml in an empty directory. You need Node.js 24.
npm install -g @ancha-labs/cli
ancha init --agent "node agent.mjs"
ancha run scene.yaml --local -n 3
ancha baseline save before
# change status = "To Do" to statusCategory != Done in agent.mjs
ancha run scene.yaml --local -n 3 --compare beforeWhen ancha runs your agent, it sets:
JIRA_BASE_URLJIRA_EMAILJIRA_API_TOKENPoint the client you already use at them.
const { JIRA_BASE_URL, JIRA_EMAIL, JIRA_API_TOKEN } = process.env;
const credentials = `${JIRA_EMAIL}:${JIRA_API_TOKEN}`;
const auth = 'Basic ' + Buffer.from(credentials).toString('base64');
const jql = encodeURIComponent('project = OPS AND statusCategory != Done');
const fields = 'summary,status,assignee';
const path = `/rest/api/3/search/jql?jql=${jql}&fields=${fields}`;
const response = await fetch(JIRA_BASE_URL + path, {
headers: { Authorization: auth, Accept: 'application/json' },
});
const { issues } = await response.json();Locally, ancha runs your agent as an ordinary process, so keep real Jira credentials out of its environment.
/rest/agile/1.0/backlog/issue/rest/agile/1.0/board/rest/agile/1.0/board/:id/rest/agile/1.0/board/:id/backlog/rest/agile/1.0/board/:id/issue/rest/agile/1.0/board/:id/sprint/rest/agile/1.0/sprint/rest/agile/1.0/sprint/:id/rest/agile/1.0/sprint/:id/rest/agile/1.0/sprint/:id/issue/rest/agile/1.0/sprint/:id/issue/rest/api/3/field/rest/api/3/issue/rest/api/3/issue/:key/rest/api/3/issue/:key/rest/api/3/issue/:key/rest/api/3/issue/:key/assignee/rest/api/3/issue/:key/changelog/rest/api/3/issue/:key/comment/rest/api/3/issue/:key/comment/rest/api/3/issue/:key/comment/:id/rest/api/3/issue/:key/comment/:id/rest/api/3/issue/:key/comment/:id/rest/api/3/issue/:key/transitions/rest/api/3/issue/:key/transitions/rest/api/3/issue/:key/watchers/rest/api/3/issue/:key/watchers/rest/api/3/issue/:key/watchers/rest/api/3/issue/bulk/rest/api/3/issue/createmeta/:key/issuetypes/rest/api/3/issue/createmeta/:key/issuetypes/:type/rest/api/3/issueLink/rest/api/3/issueLink/:id/rest/api/3/issueLink/:id/rest/api/3/issueLinkType/rest/api/3/issuetype/rest/api/3/label/rest/api/3/myself/rest/api/3/priority/rest/api/3/project/rest/api/3/project/:key/rest/api/3/project/:key/components/rest/api/3/project/:key/statuses/rest/api/3/project/:key/versions/rest/api/3/project/search/rest/api/3/resolution/rest/api/3/search/rest/api/3/search/rest/api/3/search/approximate-count/rest/api/3/search/jql/rest/api/3/search/jql/rest/api/3/serverInfo/rest/api/3/status/rest/api/3/statuscategory/rest/api/3/user/rest/api/3/user/assignable/search/rest/api/3/user/searchIt keeps data between calls: an issue or comment your agent creates is there on the next search. Ancha’s mock serves the Jira Cloud REST API v3 and the Jira Software agile API for projects, issues, comments, transitions, JQL search, boards and sprints, with the projects and issues you seed.
Write the projects and issues into a test, run the agent with ancha, and check its calls. ancha sets JIRA_BASE_URL, JIRA_EMAIL and JIRA_API_TOKEN for the agent. The example on this page needs no Atlassian account, API token or model.
Atlassian’s sandboxes are copies of a production Jira site on Premium and Enterprise plans, for trying out changes. Ancha’s mock starts from the issues a test seeds and needs no Atlassian account, and every trial starts from the same data.
JQL runs against the seeded issues. statusCategory != Done finds work in To Do, In Progress and In Review, and a status the workflow does not have returns Jira’s 400 error. POST /rest/api/3/search/jql returns issue ids unless you request fields, as on Jira Cloud.
Yes. A test can name several tools, and they share one seeded company. The example on this page reads Zendesk ticket #4101 and works in Jira in the same world, and its checks read the agent’s calls.
No. Your agent talks to the JIRA_BASE_URL and token that ancha sets, so every issue and comment it writes stays in the simulated project.
Run the example on your machine.
Ancha is not affiliated with Jira.