Skip to main content

Requirements

The requirements endpoints allow you to retrieve requirements that are linked to test cases within a project. Requirements help track traceability between test cases and external specifications, user stories, or other documentation.

About Requirements

Requirements are references to external documentation or specifications that test cases are designed to verify. They consist of:

  1. Text: A descriptive label for the requirement (1-255 characters)
  2. URL (optional): A link to the external requirement document or issue tracker

Requirements can be linked to multiple test cases, and a single test case can be linked to multiple requirements. This enables full traceability between your tests and the specifications they validate.

tip
  • Requirements can be linked to Jira issues when a Jira integration is configured for the project
  • Use include=tcaseCount to see how many test cases are linked to each requirement
  • Requirements without any linked test cases are still returned in the list

List Requirements

GET/api/public/v0/project/{project_id}/requirement

Retrieves all requirements within a project, optionally sorted and with additional fields included.

Path Parameters

  • project_id: The project identifier (can be either the project code or UUID)

Query Parameters

All query parameters are optional.

ParameterTypeDescriptionAllowed ValuesExample
sortFieldstringField to sort bycreated_at, textsortField=text
sortOrderstringSort order (requires sortField; default: desc)asc, descsortOrder=asc
includestringInclude additional fields in the response which are omitted by defaulttcaseCountinclude=tcaseCount
tip
  • Use include=tcaseCount to see how many test cases are linked to each requirement
  • Sorting by created_at shows the most recently created requirements first (with desc) or oldest first (with asc)
  • Sorting by text provides alphabetical ordering

Example Request

Fetch all requirements

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement

Fetch all requirements sorted by text in ascending order

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement?sortField=text&sortOrder=asc

Fetch all requirements with test case count included

curl \
-H "Authorization: ApiKey your.api.key.here" \
https://your-company.your-region-code.qasphere.com/api/public/v0/project/BD/requirement?include=tcaseCount

Response Fields

{
requirements: Array<{ // List of requirement objects
id: string // Unique identifier of the requirement (HQID7 format)
text: string // Descriptive label for the requirement
url: string // URL to the external requirement document (empty string if not set)
integrationLink?: { // Jira integration link (only present if linked to Jira)
issueId: string // Jira issue ID (e.g., "PROJ-123")
issueTitle: string // Title of the Jira issue
issueUrl: string // Full URL to the Jira issue
remoteLinkId: number // Jira remote link ID
}
tcaseCount?: number // Number of test cases linked to this requirement (only included if requested)
}>
}

Example Response

{
"requirements": [
{
"id": "1CKgJ5HMU_1VQTDrRJDdDVW",
"text": "User Authentication",
"url": "https://docs.example.com/specs/auth",
"tcaseCount": 5
},
{
"id": "1CKgJ5HMU_2BJje4hdXZHag",
"text": "PROJ-456",
"url": "https://jira.example.com/browse/PROJ-456",
"integrationLink": {
"issueId": "PROJ-456",
"issueTitle": "Implement password reset functionality",
"issueUrl": "https://jira.example.com/browse/PROJ-456",
"remoteLinkId": 12345
},
"tcaseCount": 3
},
{
"id": "1CKgJ5HMU_3apSDSQWRw6Ys",
"text": "Performance Requirements",
"url": ""
}
]
}