Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can use Zephyr Enterprise REST API to search for test cases, requirements, and executions (??????) programmatically.

Request URL

Code Block
languagetext
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=100
      &is_cfield=false
      &isOld=false

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 zql=true in the request). For example:

  • test

  • project="Portfolio" and executionStatus=PASS

...

entitytype (required)

...

string

...

The type of the entity to search for.

...

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.

...

order (optional)

...

string

...

The column order. For example, the parameter value can be orderId: .../flex/services/rest/v3/advancesearch/?word=test&firstresult=0&maxresults=50&order=orderId&releaseid=1

...

firstresult (required)

...

integer

...

The starting point of the record.

...

maxresults (required)

...

integer

...

The number of records to be fetched.

...

is_cfield (optional)

...

boolean

...

Custom field order.

...

isOld (optional)

...

boolean

...

Specifies whether the test case is old.

Authentication

You can authenticate your requests by using one of the methods described in the Zephyr REST API topic.

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 10:You can use Zephyr Enterprise REST API to search for test cases, requirements, and executions programmatically.

Request URL

Code Block
languagetext
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=50000
      &is_cfield=false
      &isOld=false

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 zql=true in the request URL). For example:

  • Text: panel

  • ZQL query: sample query will go here

entitytype (required)

string

The type of the entity to search for. Possible values:

  • requirement

  • testcase

  • execution

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:

Image Added

zql (required)

boolean

Specifies whether ZQL is used. false by default. Set to true if the word parameter contains a ZQL query.

isascorder (optional)

boolean

Switches the ascending order. Specify true to sort the results in the ascending order or false to sort them in the descending order. By default, it is true.

order (optional)

string

The field to sort data by. For example: testcaseId, automated, priority, creatorId, orderId and so on. The default parameter value is orderId.

firstresult (required)

integer

The first element of the retrieved results. The parameter is zero-based, which means you need to specify 0 as the start position to begin with the first element.

maxresults (required)

integer

The number of records to be fetched. The maximum number is 50000.

is_cfield (optional)

boolean

Set to true to check whether sorting is done by a custom field. By default, it is false.

isOld (optional)

boolean

Set to true to get the new test case name if the name has changed. The default value is false.

Это то, как я это понимаю. Разработчики сами не знают толком что это. Вот что мне ответила Divyashree:

for isOld parameter, got input from dev saying that "we are fetching newTestcase id , by passing the given old testcase id".
But even they're not sure like why this parameter is actually used.
The default value is false for this.

Authentication

You can authenticate your requests by using one of the methods described in the Zephyr REST API topic.

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 10:

GET /flex/services/rest/latest/advancesearch?word=test&entitytype=testcase&releaseid=1&zql=false&firstresult=0&maxresults=10

Sample requests

GET /flex/services/rest/latest/advancesearch?word=panel&entitytype=testcase&releaseid=1&zql=false&firstresult=0&maxresults=10&order=orderId&isascorder=true

GET /flex/services/rest/latest/advancesearch?word=testsample zql query will go here&entitytype=testcase&releaseid=1&zql=falsetrue&firstresult=0&maxresults=10

...

maxresults=50

Sample response

On success, the operation returns status code 200 and a JSON object containing metadata and results.

Code Block
languagejson
[
   {
      "firstResult": 0,
      "resultSize": 1,
      "results": [
         {
            "id": 147,     ----------------------------------- The RTS ID (the execution ID)
            "assignmentDate": "2020-09-15",
            "actualTime": 600,
            "versionId": "1",
            "comment": "This is a comment",
            "testerId": 5,
            "executedBy": 5,
            "tcrTreeTestcase": {
               "id": 308,  ----------------------------------- The TCR Catalog Tree TestCase ID (tctid)
               "tcrCatalogTreeId": 30,
               "revision": 9,
               "stateFlag": 0,
               "lastModifiedOn": 1600168120466,
               "versionNumber": 1,
               "createDatetime": 1600168114777,
               "createdById": 5,
               "modifiedById": 5,
               "testcase": { {
                  "customProperties": {
                  },
                  "customPropertiescustomProcessedProperties": {
                  },
                  "id": 165, ----------------------------------- The test case version ID
  "customProcessedProperties": {               "name": "edited 159 testcase }edit",
                  "iddescription": 165, ----------------------------------- The test case version ID
   "",
                  "lastModifiedOn": 1600169396082,
              "name": "edited 159 testcase edit"creationDate": 1600128000000,
                  "descriptioncreateDatetime": ""1600168102437,
                  "lastModifiedOntcCreationDate": 1600169396082"09/15/2020",
                  "creationDatecomments": 1600128000000"",
                  "createDatetimeisComplex": 1600168102437false,
                  "tcCreationDateestimatedTime": "09/15/2020"600,
                  "commentswriterId": ""0,
                  "isComplexcreatorId": false5,
                  "estimatedTimelastUpdaterId": 6005,
                  "writerIdoldId": 0,
                  "creatorIdautomated": 5false,
                  "lastUpdaterIdcustomFieldProcessed": 5false,
                  "oldIdcustomFieldValues": 0,[
                   "automated": false, 
                 "customFieldProcessed": false],
                  "customFieldValuestestcaseSequence": [{
                     "seqNumber": 159
                 ] },
                  "testcaseSequencetestcaseId": {
  159, ----------------------------------- The test case ID
                  "seqNumberversionNumber": 1591,
                  }"projectId": 3,
                  "testcaseId": 159, ----------------------------------- The test case ID    "testcaseType": "ORIGINAL",
                  "versionNumberrequirementIds": 1, [
                     
                 "projectId": 3],
                  "testcaseTypeprojectName": "ORIGINALP1",
                  "requirementIdsrequirementIdsNew": [
                     
                  ],
                  "projectNamecreatorName": "P1John Smith",
                  "requirementIdsNewlastModifierName": ["John Smith",
                  "automatedDefault": false,
                   ],"testcaseShared": false
                  "creatorName": "John Smith",
 },
                "lastModifierNameprojectId": "John Smith",
  3,
               "automatedDefaultreleaseId": false,
   5,
               "testcaseSharedisDerivedFromBDD": false,
               }"orderId": 453,
               "projectIdmaxVersionNumber": 31,
               "releaseIdprojectIdParam": 53,
               "isDerivedFromBDDoriginal": false,
               "orderId": 453,
  },
            "maxVersionNumbercyclePhaseId": 17,
  
            "projectIdParamlastTestResult": 3,{
               "original": falseid": 58,
               "executionDate": }1600169404251,
               "cyclePhaseIdexecDate": 7,"09/15/2020",
               "lastTestResultexecutionStatus": {"4",
               "idtesterId": 585,
               "executionDatereleaseTestScheduleId": 1600169404251147,
               "execDatecreateDatetime": "09/15/2020"1600169404253,
               "executionStatus": "4"modifiedDatetime": 1600169404250,
               "testerIdcreatedById": 5,
               "releaseTestScheduleIdmodifiedById": 147,5
            },
  "createDatetime": 1600169404253,          "defects": [
       "modifiedDatetime": 1600169404250,       
        "createdById": 5,   ],
            "modifiedByIdattachmentCount": 0,
5            "lastModifiedBy": }5,
            "defects": [createdById": 5,
            "lastModifiedOn": 1600169404255,
            "createDatetime": 1600168120467
 ],        }
     "attachmentCount": 0],
      "type": "testSchedule"
    "lastModifiedBy": 5,}
]

If no items matching the specified criteria are found, an empty results array is returned:

Code Block
[
    {
        "createdByIdfirstResult": 50,
            "lastModifiedOnresultSize": 16001694042550,
 
          "createDatetimeresults": 1600168120467[],
         }
      ],
      "type": "testScheduletestcase"
    }
]

Response codes

HTTP Status Code

Description

200

The request completed successfully.

400

Bad request. At least one releaseid or departmentid parameter is required.

401

The authentication token is missing.

403

The user has no permissions to perform this operation.

500

Unknown internal error.

...