# Aio Tests API Connection

> Connects Cursor to AIO Tests via REST API: auth, base URL, project keys (DEV, SOUTH, LOKA), common endpoints (cases, cycles, execution, folders, traceability), status IDs, troubleshooting. Use when listing/searching/creating AIO test artifacts, reporting runs, or verifying API access. Use proactively for any AIO Tests API or tcms.aiojiraapps.com work.

- Skill: `carolina1-po/aio-tests-api-connection` (Agent Skill)
- Install (CLI): `npx skillmds@latest add carolina1-po/aio-tests-api-connection`
- Raw SKILL.md: https://api.skillmd.com/api/skills/carolina1-po/aio-tests-api-connection/raw
- Safety review: pending (external: skill-scanner PASS, skillspector CAUTION)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: Carolina1-Po (https://skillmd.com/u/carolina1-po)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/carolina1-po/aio-tests-api-connection

---


# AIO Tests API — Cursor connection

Use this skill whenever you call the AIO Tests REST API from Cursor (terminal `curl`, scripts, or guided steps).

## Overview

AIO Tests exposes a REST API for test management. From Cursor you can:

- List, search, and create test cases (Classic or BDD/Gherkin)
- Manage test cycles (create, update, close)
- Report execution results (pass/fail/blocked)
- Import automation results (TestNG, JUnit, Cucumber, etc.)
- View traceability between Jira requirements and test cases
- Access folder structures, tags, and project configuration

## Projects

| Project | Key     | Description                |
| ------- | ------- | -------------------------- |
| DEV     | `DEV`   | Main ProofPilot platform   |
| South   | `SOUTH` | International Trial Finder |
| Loka    | `LOKA`  | Enrollment & analytics     |

## Authentication and base URL

- **Base URL:** `https://tcms.aiojiraapps.com/aio-tcms/api/v1/`
- **Auth header:** `Authorization: AioAuth <YOUR_TOKEN>`
- **Project key:** `DEV`, `SOUTH`, or `LOKA`

Each person uses their own token. Never commit tokens or echo them into logs/commits.

### Generate an AIO API token

1. Open any Jira project at [proofpilot.atlassian.net](https://proofpilot.atlassian.net)
2. Open the **AIO Tests** app (sidebar or Apps)
3. Click the **gear** (top right of AIO) → **My Settings**
4. **API Token** → **Manage API Token** → **Generate API Token**
5. Copy and store it; you cannot view it again later

### Verify connection

```bash
curl -s "https://tcms.aiojiraapps.com/aio-tcms/api/v1/project/DEV/config" \
  -H "Authorization: AioAuth <YOUR_TOKEN>" | python3 -m json.tool
```

A JSON body with `caseTypes`, `casePriorities`, etc. means the connection works. Swap `DEV` for `SOUTH` or `LOKA` as needed.

## Common operations

### List test cases

`GET /project/{projectKey}/testcase`

### Search test cases

`POST /project/{projectKey}/testcase/search`  
Body: `{ "queryString": "search term" }`

### Get test case detail (with steps)

`GET /project/{projectKey}/testcase/{caseKey}/detail`

### Create a test case

`POST /project/{projectKey}/testcase`

Use numeric **`folderID`** from `GET /project/{projectKey}/testcase/folder`.

**`scriptType` must be an object**, not a string. Examples:

- Classic: `"scriptType": {"ID": 1}`
- BDD/Gherkin: `"scriptType": {"ID": 2}`

Sending `"scriptType": "BDD"` returns **400** (deserialize error).

Minimal create example (BDD, Draft, folder 95):

```json
{
  "title": "My BDD case",
  "statusID": 1,
  "folderID": 95,
  "scriptType": {"ID": 2}
}
```

### Update a test case (steps, folder, Jira links, status)

`PUT /project/{projectKey}/testcase/{numericCaseId}/detail`

Use the numeric **`ID`** from the create response (not only the `DEV-TC-` key in all environments). Body can include `steps` for BDD (`stepType`: `BDD_GIVEN`, `BDD_WHEN`, `BDD_THEN`, `BDD_AND` with `bddStep` text), `folder`: `{"ID": <folderID>}`, `jiraRequirementIDs`, and `status`: `{"ID": 4}` for Deprecated, etc.

### List test cycles

`GET /project/{projectKey}/testcycle`

### Get cycle summary

`GET /project/{projectKey}/testcycle/{cycleKey}/summary`

### Create a test cycle

`POST /project/{projectKey}/testcycle/detail`  
Example: `title`, `objective`

### Report execution results

`POST /project/{projectKey}/testcycle/{cycleKey}/testcase/{caseKey}/testrun`  
Example: `testRunStatus` (`Passed` / `Failed` / `Blocked`), `effort` (seconds)

### Import automation results (JUnit/TestNG)

`POST /project/{projectKey}/testcycle/{cycleKey}/import/results?type=JUnit`  
Form: `file=results.xml`

### Folder tree

`GET /project/{projectKey}/testcase/folder`

### Traceability

`GET /project/{projectKey}/traceability/requirement/{jiraIssueId}`

## API reference

- Swagger: [https://tcms.aiojiraapps.com/aio-tcms/aiotcms-static/api-docs/](https://tcms.aiojiraapps.com/aio-tcms/aiotcms-static/api-docs/)

### Endpoint groups (summary)

| Category          | Capabilities                                                              |
| ----------------- | ------------------------------------------------------------------------- |
| Cases             | List, search, create, update, detail, export BDD features                 |
| Cycles            | List, search, create, update, delete, close/open                         |
| Execution         | Add cases to cycles, results, bulk update, import results                 |
| Sets              | List, create, add cases                                                   |
| Configuration     | Statuses, priorities, folders, tags, custom fields, automation statuses   |
| Traceability      | Link Jira requirements to test cases                                      |

### Status IDs (DEV project reference)

**Case statuses**

| ID | Status       |
| -- | ------------ |
| 1  | Draft        |
| 2  | Under Review |
| 3  | Published    |
| 4  | Deprecated   |

**Run statuses**

| ID | Status      |
| -- | ----------- |
| 1  | Not Run     |
| 2  | In Progress |
| 3  | Passed      |
| 4  | Failed      |
| 5  | Blocked     |

**Automation statuses**

| ID | Status                   |
| -- | ------------------------ |
| 1  | Manual Only              |
| 2  | Manual - To Be Automated |
| 4  | Automated                |

**Environments (custom field ID 5)**

| ID | Value |
| -- | ----- |
| 1  | DEV   |
| 2  | UAT   |
| 3  | PROD  |

## Troubleshooting

| Issue              | What to check                                                                 |
| ------------------ | ----------------------------------------------------------------------------- |
| `401 Unauthorized` | Token invalid/expired — regenerate in AIO → My Settings → API Token         |
| `403 Forbidden`    | Jira user lacks access to that AIO project                                    |
| `404 Not Found`    | Wrong project key or resource key                                             |
| Empty results      | Confirm data exists; hit `/project/{key}/config` first                        |

## Security

- One token per person; tied to Jira permissions
- Never commit tokens; revoke if compromised (Manage API Token → Revoke), then reissue

## Related links

- [AIO Process Document](https://proofpilot.atlassian.net/wiki/spaces/RM/pages/813039617/AIO+Process+Document)
- [QA Wolf Automation Process](https://proofpilot.atlassian.net/wiki/spaces/RM/pages/812613635/QA+Wolf+-+Automation+Process+Document)
- [AIO Tests REST API Docs](https://aiosupport.atlassian.net/wiki/spaces/AioTests/pages/2025619567/Rest+APIs)

