search_test_cases
Search Zephyr Scale test cases with a TQL query; filter by project, status, folder, labels, or keys, choose fields, and paginate results.
Instructions
Search test cases with a TQL query (GET /testcase/search). A query longer than 1500 characters is sent as POST /testcase/search instead, which supports ONLY the fields projectKey, key and name and at most 2500 values per IN list. That POST endpoint is missing or broken on some Zephyr Scale Server builds, so prefer staying under 1500 characters (split a long IN list across calls); when a POST search fails the error says which transport was used and why.
Unknown VALUES are validated inconsistently: an unknown status, priority, component or projectKey is rejected with 400, while an unknown label in an IN list and an unknown key inside key IN (…) are silently skipped and just shrink the result set — a typo there is indistinguishable from no match. isLast is a heuristic, so an exactly full page always reports isLast false even when it is the last one: stop when values is empty.
TQL quick reference:
Test case fields: projectKey, key, name, status, priority, component, folder, estimatedTime, labels, owner, issueKeys + custom fields (field name in double quotes).
Test run (cycle) fields: ONLY projectKey and folder.
Operators: =, >, >=, <, <=, IN; the only logical connector is AND (no OR).
Syntax is strict: spaces around operators are mandatory, string values in double quotes. Folder paths start with "/" ("/" is the root). For single/multi-choice custom fields '=' does not work — use IN.
Examples: projectKey = "PROJ" AND status = "Draft" AND priority = "High" projectKey = "PROJ" AND folder = "/Regression/Payments" projectKey = "PROJ" AND labels IN ("smoke", "ui") projectKey = "PROJ" AND "My Field" IN ("Value") key IN ("PROJ-T50", "PROJ-T90") projectKey = "PROJ" AND issueKeys IN ("PROJ-5")
Returns { startAt, maxResults, count, isLast, values }; isLast is the heuristic count < maxResults. Paginate with startAt (default 0) and maxResults (default 50; the API server-side default is 200).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | TQL query, e.g. projectKey = "PROJ" AND status = "Draft" (see the description for the syntax) | |
| fields | No | Return only these fields, e.g. ["key","name","status"]; sent to the API as one comma-separated parameter | |
| startAt | No | 0-based index of the first result to return (default 0) | |
| maxResults | No | Maximum number of results to return (default 50; the API server-side default is 200) |