Skip to main content

Results

The results endpoint allows you to add results for test cases in runs. Only users with role test runner or with higher priveleges, having access to a project can add results.

Add Result

POST/api/public/v0/project/{project_id}/run/{run_id}/tcase/{tcase_or_legacy_id}/result

Add result for a run test case.

tip

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. For more information on viewing and updating custom statuses using public APIs, please refer to the Settings page.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)
  • run_id: The run identifier
  • tcase_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: string // Optional: Comments/observations while executing the test case
timeTaken: number | null // Optional: Time taken for executing the test case
links: Array<{ // Optional: Issues created on external integrations
integrationId: string | null // Optional: Unique identifier of the external integration (if any)
url: string // Required: URL of the external issue
text: string // Required: Title of the external issue
meta: object // Optional: Additional information related to the issue
}>
}

Response Fields

FieldTypeDescription
idnumberUnique identifier for the result

Example Request

curl \
-H "Authorization: ApiKey your.api.key.here" \
-H "Content-Type: application/json" \
-d '{
"status": "failed",
"comment": "Login page background color is not correct",
"links": [{
"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 CodeDescription
401Invalid or missing API key
403Insufficient permissions or suspended tenant
404Project not found
500Internal server error while adding result
Validation

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.