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

# Exporting Test Cases

> Export your test case definitions, including steps, via the API or CLI

Export all test case definitions from your project, including names, goals, expected results, and step-by-step instructions. This is useful for migrating to another test management tool (for example Jira with Xray or Zephyr), keeping external backups, or building custom reports.

## What Gets Exported

The [List Test Cases](https://docs.qa.tech/api-reference/test-cases/list-test-cases.md) endpoint returns published test cases. Each test case includes its name, goal, expected result, labels, attached references (PRs, issues, TMS cases, and chats), enabled state, classification, and the most recent run status. When you pass `includeSteps=true`, each test case also includes a `steps` array with step-by-step instructions.

See the [List Test Cases reference](https://docs.qa.tech/api-reference/test-cases/list-test-cases.md) for the full response schema.

> [!NOTE]
>
> Steps are opt-in via the `includeSteps` query parameter to keep default
> responses small. Test cases that are defined by a goal only (without a step
> breakdown) return an empty `steps` array.

## Export via the API

Pass `includeSteps=true` to include the full step definitions:

```bash theme={null}
curl "https://api.qa.tech/v1/test-cases?includeSteps=true&limit=1000" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

The endpoint returns up to 1000 test cases per request. If your project has more, page through the results with `offset`:

```bash theme={null}
curl "https://api.qa.tech/v1/test-cases?includeSteps=true&limit=1000&offset=1000" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

See the [API Introduction](https://docs.qa.tech/api-reference/introduction.md#authentication) for how to create an API token. With an organization-scoped key, also pass `projectShortId` as a query parameter.

## Export via the CLI

The [qatech CLI](https://docs.qa.tech/cli/overview.md) wraps the same endpoint:

```bash theme={null}
qatech test-cases --include-steps --json > test-cases.json
```

See [qatech test-cases](https://docs.qa.tech/cli/commands/test-cases.md) for all options.

## Converting to CSV

Many test management importers expect one row per step. This `jq` one-liner converts the JSON export into that shape:

```bash theme={null}
qatech test-cases --include-steps --json | jq -r '
  ["Test Case ID", "Test Case Name", "Step Number", "Step Instruction", "Step Expected Result"],
  (.testCases[] | . as $tc | .steps // [] | to_entries[] |
    [$tc.id, $tc.name, (.key + 1), .value.instruction, (.value.expectedResult // "")])
  | @csv' > test-case-steps.csv
```

For a one-row-per-test-case shape with numbered steps in a single column:

```bash theme={null}
qatech test-cases --include-steps --json | jq -r '
  ["Test Case ID", "Name", "Goal", "Expected Result", "Steps"],
  (.testCases[] |
    [.id, .name, (.goal // ""), (.expectedResult // ""),
     ([.steps // [] | to_entries[] | "\(.key + 1). \(.value.instruction)"] | join("\n"))])
  | @csv' > test-cases.csv
```

## Related documentation

* [List Test Cases](https://docs.qa.tech/api-reference/test-cases/list-test-cases.md) - Full endpoint reference
* [qatech test-cases](https://docs.qa.tech/cli/commands/test-cases.md) - CLI command reference
* [API Introduction](https://docs.qa.tech/api-reference/introduction.md) - Authentication and ID reference


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