Skip to main content

List Test Cases (API)

Find Test Cases in a Jira space or linked to a work item or Test Folder, and retrieve their matching execution results.

Use this API to find Vansah Test Cases in a Jira space, or retrieve Test Cases linked to a Jira work item or Test Folder. Filter the results for your automation or reporting workflow and read them a page at a time.

Before you begin

Create a Vansah API token and use the Vansah URL supplied for your workspace. The token account must be able to access the Jira space.

The examples use Bash and cURL. Set VANSAH_URL to your Vansah base URL without a trailing slash and VANSAH_TOKEN to your API token. Replace DEMO with your Jira space key. Keep your token private.

Endpoint and headers

GET /api/v2/testCases

Header

Value

Authorization

Your Vansah API token, without a Bearer prefix.

Accept

application/json

Send the parameters in the query string. No JSON request body is needed. The API parameter projectKey refers to the Jira space key.

1. Choose the Test Cases to retrieve

Parameter

How to use it

projectKey

The Jira space key, for example DEMO. Include it to provide space context when using an API token.

issueKey

Optional. Retrieve Test Cases linked to a Jira work item, for example DEMO-123.

testFolderIdentifier

Optional. Retrieve Test Cases linked to a Test Folder using its UUID. Supply the identifier, not the folder name or path.

caseKey

Optional. One exact Test Case key, for example DEMO-C42. This parameter does not accept a comma-separated list.

caseIdentifier

Optional. Filter by a Test Case UUID.

testCaseVersion

Optional. Select a version when retrieving Test Cases without a folder or work item scope. The default is each Test Case’s current version. With a linked folder or work item, the linked version is used.

Without a work item, folder, or Test Case selector, the request lists Test Cases in the selected Jira space. For a Standard Test Plan and its iterations, use List Test Cases in a Standard Test Plan (API).

Example: list Test Cases in a Jira space

curl --request GET --get \
--url "$VANSAH_URL/api/v2/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50" \
--data-urlencode "sortBy=caseKey" \
--data-urlencode "sortOrder=asc"

Example: list Test Cases linked to a work item

Replace DEMO-123 with the Jira work item key:

curl --request GET --get \
--url "$VANSAH_URL/api/v2/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "issueKey=DEMO-123" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50"

To retrieve a folder’s linked Test Cases instead, replace issueKey=DEMO-123 with testFolderIdentifier=YOUR_FOLDER_UUID, using the folder’s actual UUID.

2. Add filters when needed

All filters below are optional. Add them using --data-urlencode so spaces and other characters are encoded correctly.

Filter

What it selects

headline

Text within the Test Case key or headline.

caseTypeName or caseTypeIdentifier

Test Case type name or UUID. Look up values with List Test Case Types.

caseStatusIdentifier

Test Case status UUID.

labelName

A label name, or comma-separated label names. Look up names with List Test Case Labels.

priorityJiraID or componentJiraID

Jira priority or component IDs. Look up priorities with List Test Case Priorities.

assigneeJiraID, ownerJiraID, createdBy, updatedBy, or testedBy

Jira account IDs for the assignee, owner, creator, last editor, or tester.

assigneeComparison, ownerComparison, createdByComparison, updatedByComparison, or testedByComparison

Use equal or unequal with the corresponding account filter.

testScript

Script format: 0 = Multi Steps, 1 = Plain Text, 2 = BDD, 3 = Automation. Multiple values can be comma-separated.

resultID

One or more result codes, comma-separated. See the table below.

environmentIdentifier, releaseJiraID, or sprintJiraID

Narrow the execution results considered using an environment UUID, Jira version ID, or Jira sprint ID.

issueCasesStatus

withIssue for Test Cases linked to a Jira work item; withNoIssue for those without a work item link.

createdStartDate and createdEndDate

Creation date range. Supply both dates.

updatedStartDate and updatedEndDate

Modification date range. Supply both dates.

testedStartDate and testedEndDate

Execution date range. Supply both dates.

timezone

Timezone for date filters, for example America/New_York. Defaults to Australia/Sydney.

deleted

0 for active Test Cases, which is the default; 1 for deleted Test Cases.

includeLinkedTestFolder

Use true to include the linkedTestFolder field with linked Test Folder paths.

Use YYYY-MM-DD for date filters, for example 2026-11-01 through 2026-11-13. Execution filters determine the latest matching result displayed; a linked Test Case without a matching execution can still appear as untested unless another filter excludes it.

Result filter codes

Code

Result

0

N/A

1

Failed

2

Passed

3

Untested

4

N/A in progress

5

Failed in progress

6

Passed in progress

7

Blocked

Example: failed Test Cases with a label

curl --request GET --get \
--url "$VANSAH_URL/api/v2/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "labelName=Smoke" \
--data-urlencode "resultID=1" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50"

3. Read the response

Example response, showing selected fields from one Test Case row:

{
"success": true,
"message": "Test Cases returned successfully",
"data": {
"pagination": {
"total": 1,
"startAt": 0,
"limit": 50
},
"data": [
{
"caseIdentifier": "b90295bd-2725-4f44-98e5-e55c671f39c8",
"caseKey": "DEMO-C42",
"headline": "Sign in with a valid account",
"testCaseVersion": 1,
"caseTypeName": "Functional",
"priorityName": "Medium",
"statusName": "Active",
"resultName": "PASSED",
"resultID": 2,
"labelName": "Smoke"
}
]
}
}

Field

Meaning

data.pagination

The total matching count, page offset, and page size.

data.data

The array of Test Case rows.

caseIdentifier and caseKey

The Test Case UUID and readable key.

testCaseVersion

The version represented by this row.

headline, caseTypeName, priorityName, and statusName

The Test Case’s title, type, priority, and status.

resultName and resultID

The latest matching execution result. Result names can reflect your configured result labels.

Rows can also contain descriptions and preconditions, rich-text values in descriptionAdf and preconditionAdf, account IDs, timestamps, labels, environment and release names, counts, and Test Run identifiers. The response is a summary rather than the full Test Script or execution log. Some missing or zero-valued fields are returned as "", so handle empty strings when reading optional values.

4. Retrieve the remaining pages

Parameter

How to use it

startAt

Record offset. Defaults to 0. Use a whole number of zero or greater.

limit

Page size. Defaults to 50. Use a positive whole number.

sortBy

Defaults to headline. Useful choices include caseKey, headline, result, priority, testedTime, caseCreatedDate, and caseModifiedDate.

sortOrder

asc or desc. Defaults to asc.

With limit=50, request startAt=50 for the second page, then 100, and continue until you have retrieved the matching records or receive an empty data.data array. Keep the space, selectors, filters, and sorting unchanged on each page.

Results in a work item or folder

When the request is scoped to a work item or folder, ignoreChildResult=1 restricts results to Test Runs executed directly in that context. Use ignoreChildResult=0, or leave it out, to also consider related Test Plan execution results. This controls the displayed result; it does not add Test Cases from subfolders.

Requests scoped to a work item or folder can also refresh its configured Vansah TR Status custom field in Jira.

Troubleshooting

Message or issue

What to check

Please provide space information

Include a valid projectKey: this is your Jira space key.

One or more validation errors found.

Inspect data.errors. Check UUIDs, account IDs, dates, numeric values, result codes, and sort options.

Folder lookup fails

Use a UUID for testFolderIdentifier, rather than a folder path.

No results for caseKey

Use one exact key, such as DEMO-C42. For a text search, use headline.

Empty list

Check the space, selected work item or folder, filters, and page offset. Retry the first page with fewer filters.

Authentication or access error

Check the Vansah URL, token, Jira space key, and the token account’s access.

Something went wrong while Getting Test Cases.

Retry with a simple request. If the issue continues, contact Vansah Support with the endpoint and response, without your token.

Example validation error:

{
"success": false,
"message": "One or more validation errors found.",
"data": {
"errors": [
{
"value": "Login/Smoke/",
"msg": "Please provide a valid testFolderIdentifier.",
"param": "testFolderIdentifier",
"location": "query"
}
]
}
}

You can also view this request in the Vansah API collection in Postman.

Did this answer your question?