Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
Starting October 11, 2024 (Zephyr Enterprise 8.2), the Zephyr Enterprise documentation moved from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise documentation page. Please see: https://support.smartbear.com/zephyr-enterprise/docs/en/zephyr-enterprise/zephyr-rest-api/search-api.html |
You can use Zephyr Enterprise REST API to search for test cases, requirements, and executions programmatically.
...
Code Block | ||
---|---|---|
| ||
GET http(s)://{ZEPHYR-SERVER}/flex/services/rest/latest/advancesearch? word=<text> &entitytype=<entitytype> &releaseid=<id> &zql=false &isascorder=true &order=<fieldname> &firstresult=0 &maxresults=50000100 &is_cfield=false |
Authentication
You can authenticate your requests by using one of the methods described in the Zephyr REST API topic.
Request parameters
Value | Type | Description |
---|---|---|
word (required) | string | A string to search for. You can specify some text or a ZQL query (in the latter case, you will have to specify
|
entitytype (required) | string | The type of the entity to search for. Possible values:
|
releaseid (required) | long | The ID of the release the entity belongs to. To see the release ID in Zephyr, click Manage Release in the top-right corner and take a look at the value of the ID column in the subsequent window: |
zql (required) | boolean | Specifies whether ZQL is used. |
isascorder (optional) | boolean | Switches the ascending order. Specify |
order (optional) | string | The field to sort data by (this can be either a standard or a custom field). For example: |
firstresult (required) | integer | The first element of the retrieved results. The parameter is zero-based, which means you need to specify |
maxresults (required) | integer | The number of records to be fetched. The maximum number is |
100. | ||
is_cfield (optional) | boolean | If the |
Pagination
You can specify the first element of the retrieved results and the number of items to show by using the firstresult
and maxresults
query parameters respectively. The firstresult
parameter is zero-based, which means you need to specify 0
as the start position to begin with the first element. The sample request below will show a list of results starting from the first element, and the maximum number of retrieved items will be 10100:
GET /flex/services/rest/latest/advancesearch?word=test&entitytype=testcase&releaseid=1&zql=false&firstresult=0&maxresults=10100
Sample requests
ZQL is not used:
GET /flex/services/rest/latest/advancesearch?word=test&entitytype=testcase&releaseid=1&zql=false&firstresult=0&maxresults=10100
ZQL is used:
GET /flex/services/rest/latest/advancesearch?word=creator="test.manager" and priority="P1"&entitytype=testcase&releaseid=1&zql=true&firstresult=0&maxresults=50100
Sample response
On success, the operation returns status code 200 and a JSON object containing metadata and found results. The structure of these results varies depending on the sought-for entities, items and so on. Below is a sample response obtained when searching for an execution:
...
Code Block |
---|
[ { "firstResult": 0, "resultSize": 0, "results": [], "type": "testcase" } ] |
Response Codes
HTTP Status Code | Description |
---|---|
200 | The request completed successfully. |
400 | Bad request. |
401 | The authentication token is missing. |
403 | The user has no permissions to perform this operation. |
500 | Unknown internal error. |
Anchor | ||||
---|---|---|---|---|
|
...