List the test cases linked to an Advanced Test Plan and review their matching execution results for an iteration. Retrieve cases across the plan, or narrow the request to a Jira work item or Test Folder requirement.
Before you begin
Have a Vansah API token and your workspace’s Vansah API URL. The token account must be able to access the Jira space.
Copy the Advanced Test Plan key, such as
DEMO-P12, from Vansah and choose an existing iteration.For a requirement-specific request, have the linked Jira work item key or exact Test Folder path.
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 the sample keys, iteration, folder path, and filters with values from your own Jira space.
Endpoint and headers
GET /api/v2/testplan/testCases
Header | Value |
Authorization | Your Vansah API token, without a |
Accept |
|
Send parameters in the query string. This GET request does not need a JSON body.
Plan, requirement, and pagination parameters
Parameter | How to use it |
| The Jira space key, for example |
| The plan key, for example |
| Optional. Existing iteration number. Defaults to |
| Optional alternative to |
| Optional. The linked requirement’s Jira work item key, for example |
| Optional. The exact path of a linked Test Folder requirement, for example |
| Optional alternative requirement selector. Use the requirement’s Vansah UUID, rather than the plan UUID. |
| Optional record offset, default |
| Optional page size, default |
| Optional. Useful sort fields include |
projectKey refers to the Jira space key; the API field name remains unchanged. Supply at most one of testPlanIssueKey, testPlanFolderPath, or testPlanAssetIdentifier. Leave all three out to retrieve cases across the plan. Do not combine testPlanKey with testFolderIdentifier.
Example: cases across the plan
curl --request GET --get \
--url "$VANSAH_URL/api/v2/testplan/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "testPlanKey=DEMO-P12" \
--data-urlencode "iterationNumber=1" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50" \
--data-urlencode "sortBy=caseKey" \
--data-urlencode "sortOrder=asc"
The response is a summary list of cases, rather than a separate execution record for every requirement. If the same case is linked to several requirements, use a requirement selector when you need the result for a particular work item or folder.
Example: a Jira work item requirement
This request selects iteration 2 and the requirement DEMO-123:
curl --request GET --get \
--url "$VANSAH_URL/api/v2/testplan/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "testPlanKey=DEMO-P12" \
--data-urlencode "testPlanIssueKey=DEMO-123" \
--data-urlencode "iterationNumber=2" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50"
Example: a Test Folder requirement with filters
This request selects iteration 2, the Regression/Checkout/ requirement, the Smoke label, and failed results. Copy the exact folder path using Copying a Test Folder Path.
curl --request GET --get \
--url "$VANSAH_URL/api/v2/testplan/testCases" \
--header "Authorization: $VANSAH_TOKEN" \
--header "Accept: application/json" \
--data-urlencode "projectKey=DEMO" \
--data-urlencode "testPlanKey=DEMO-P12" \
--data-urlencode "testPlanFolderPath=Regression/Checkout/" \
--data-urlencode "iterationNumber=2" \
--data-urlencode "labelName=Smoke" \
--data-urlencode "resultID=1" \
--data-urlencode "startAt=0" \
--data-urlencode "limit=50"
Filter the results
Filter | What it does |
| Find a case by its exact readable key or UUID. |
| Search the case headline, or match a label. Label names can be comma-separated. |
| Filter by case type or status. Use the relevant name or UUID. |
| Filter using Jira priority or component IDs. |
| Filter by one or more comma-separated result codes: |
| Filter using Jira account IDs. The corresponding comparison parameter, such as |
| Narrow which executions are considered. A linked case without a matching execution can still appear as untested. |
Date pairs and | Use |
Use --data-urlencode to encode spaces and other special characters in query values.
Read the response and retrieve the remaining pages
Example response showing selected fields from a 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",
"resultName": "PASSED",
"resultID": 2,
"eprKey": 2
}
]
}
}data.paginationcontainstotal,startAt, andlimit. Pagination is nested insidedata.data.datacontains the case rows.caseIdentifierandcaseKeyidentify the case;testCaseVersionidentifies the linked version.resultNameandresultIDdescribe the latest matching result. Result names can use your configured labels.eprIdentifierandeprKeyidentify the matching Test Run’s iteration when a run exists.Additional fields include case descriptions, account IDs, environment and release names, timestamps, attachment counts, and Test Run identifiers. Optional or zero-valued fields may be returned as empty strings, so handle
""values.
This endpoint does not return the full script-step list or every execution log.
For a page size of 50, request startAt=50, then 100, until all matching records are retrieved or the next page is empty. Keep the plan, iteration, requirement, filters, and sort order unchanged between pages. Counts can change if the underlying data changes while you are paging.
Troubleshooting
Message or issue | What to check |
| Read |
Invalid Test Plan key or key format | Copy the plan key from Vansah. Check that the plan is active and in the expected workspace. |
Invalid iteration number or | Use an existing active iteration belonging to the plan. Do not send both iteration selectors. |
Invalid | Check the work item key or exact folder path. The requirement must also be linked to the plan to return matching cases. |
Conflicting requirement selectors | Keep only one of the three requirement selectors. |
Empty list | Check the selected iteration, requirement, filters, and offset. Retry the first page without optional filters. |
Authentication or space access error | Check the Vansah API URL, token, Jira space key, and the token account’s access. |
An empty matching list is a successful response:
{
"success": true,
"message": "Test Cases returned successfully",
"data": {
"pagination": {
"total": 0,
"startAt": 0,
"limit": 50
},
"data": []
}
}
You can also view this request in the Vansah API collection in Postman.
