Results
The results endpoint allows you to add results for test cases in runs. Only users with role test runner or with higher privileges, having access to a project can add results.
Each test case result is assigned a status reflecting the outcome of its execution. QA Sphere supports several common statuses: passed, failed, blocked, skipped, and open. If you require additional statuses, QA Sphere allows you to create up to four custom statuses. These custom statuses can be used in the results as custom1, custom2, custom3, custom4. For more information on viewing and updating custom statuses using public APIs, please refer to the Settings page.
You can also attach links to external issues created in integrations configured for the project. If the corresponding issue ID/key is provided in the meta information, QA Sphere will add a comment on the issue for non-custom integrations (GitHub, Jira, Linear) to create a bi-directional reference:
- GitHub/Jira: Issue number (e.g.,
"123") - Linear: Issue key (e.g.,
"PRJ-123")
Add Result
Add result for a run test case.
Path Parameters
project_id: The project identifier (can be either the project code or UUID)run_id: The run identifiertcase_or_legacy_id: The test case identifier (can be one of test case UUID, sequence or legacy ID)
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
status: string // Required: Result status ("passed" | "failed" | "blocked" | "skipped" | "open" | "custom1" | "custom2" | "custom3" | "custom4")
comment: html // Required: Comments/observations while executing the test case
timeTaken?: number // Optional: Time taken for executing the test case
links?: Array<{ // Optional: Links to issues on external integration to attach to this result
integrationId: string // Required: Unique identifier of the project integration
url: string // Required: URL of the external issue
text: string // Required: Title of the external issue
meta?: { // Optional: Additional information related to the issue (for non-custom integrations)
id?: string // Optional: Issue ID/key used to add a comment on the external issue linking back to this result
}
}>
}
Response Fields
| Field | Type | Description |
|---|---|---|
id | number | Unique identifier for the result |
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"status": "failed",
"comment": "<p>Login page background color is not correct</p>",
"links": [{
"integrationId": "1CSWAh3ys_YniqfXepnwT8F",
"url": "https://external-integration/issues/1",
"text": "Login page background color is not correct"
}],
"timeTaken": 60
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/tcase/1/result
Example Response
{
"id": 10
}
Error Responses
| Status Code | Description |
|---|---|
| 401 | Invalid or missing API key |
| 403 | Insufficient permissions or suspended tenant or project is archived |
| 404 | Project or test run or test case not found |
| 409 | Test run is closed |
| 500 | Internal server error while adding result |
Add Multiple Results
Add results for multiple test cases in a run.
Path Parameters
project_id: The project identifier (can be either the project code or UUID)run_id: The run identifier
Authentication
Requires an API key with at least Test Runner role permissions. See Authentication for more details.
Request Body
{
items: Array<{ // Required: List of result items
tcaseId: string // Required: The unique identifier of the test case
status: string // Required: Result status ("passed" | "failed" | "blocked" | "skipped" | "open" | "custom1" | "custom2" | "custom3" | "custom4")
comment: html // Required: Comments/observations while executing the test case
timeTaken?: number // Optional: Time taken for executing the test case
links?: Array<{ // Optional: Links to issues on external integration to attach to this result
integrationId: string // Required: Unique identifier of the external integration
url: string // Required: URL of the external issue
text: string // Required: Title of the external issue
meta?: { // Optional: Additional information related to the issue (for non-custom integrations)
id?: string // Optional: Issue ID/key used to add a comment on the external issue linking back to this result
}
}>
}>
}
Response Fields
| Field | Type | Description |
|---|---|---|
ids | number[] | List of IDs for the created results, in the same order as the request |
Example Request
curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"tcaseId": "1CSm3erpq_Ykq6AVPRrLYd1",
"status": "failed",
"comment": "<p>Login page background color is not correct</p>",
"links": [{
"integrationId": "1CSWAh3ys_YniqfXepnwT8F",
"url": "https://external-integration/issues/1",
"text": "Login page background color is not correct"
}],
"timeTaken": 60
},
{
"tcaseId": "1CSaE4bJE_mHke3r3yJRAgk",
"status": "passed",
"comment": ""
},
{
"tcaseId": "1CSaDwU7T_FKcgke4dVwJNP",
"status": "custom3",
"comment": "<p>Page failed to load</p>",
"links": [{
"integrationId": "1CSWAh3ys_YniqfXepnwT8F",
"url": "https://external-integration/issues/1",
"text": "Page failed to load"
}]
}
]
}' \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/run/1/result/batch
Example Response
{
"ids": [11, 12, 13]
}
Error Responses
| Status Code | Description |
|---|---|
| 401 | Invalid or missing API key |
| 403 | Insufficient permissions or suspended tenant or project is archived |
| 404 | Project or test run not found |
| 409 | Test run is closed |
| 500 | Internal server error while adding result |
The system validates that the run belongs to the project, test case belongs to the run, the project is not archived and the run is not closed. Attempting to add result which does not satisfy these validations will result in an error.