How to update test cases status/execution status in zephyr scale using postman calls

Rohit Sinha March 21, 2023

I am trying to update/change the execution status of the test cases in Zephyr scale via postman. For example, I want to change the status of a test case from Pass to Fail either under Test Cycles/Cases or Test executions. I tried few of the below POST/PUT calls but get errors such as, "Method Not allowed" or "Invalid Payload":

Option 1: POST

URL: ...//api.zephyrscale.smartbear.com/v2/testexecutions

Request Body: 

{

"createTestExecution.projectKey": "B2B", 

"createTestExecution.statusName": "PASS", 

"createTestExecution.testCaseKey": "B2B-T1082", 

"createTestExecution.testCycleKey": "B2B-R33"

}

Option 2: PUT/POST

URL: ...//api.zephyrscale.smartbear.com/v2/testcases/B2B-T1082

Request Body: 

{
    "updateTestCase.key""B2B-T1082",
    "updateTestCase.name""Terms of Use",    
    "updateTestCase.status": {
        "id"2472038
    }

Could anyone please help me with the correct syntax of the API call in Postman for changing the status of test cases/executions in Zephyr scale.

2 answers

0 votes
Markos Hudson November 7, 2023

The below JSON payload worked for me POST to url = "https://api.zephyrscale.smartbear.com/v2/testexecutions";

payload = {
  "projectKey": "ARB",
  "testCaseKey": "ARB-T142",
  "testCycleKey": "ARB-R188",
  "statusName": "Pass",
  "comment": "result submitted via REST API",
  "environmentName": "Dev",
  "executionTime": 5150
}

I followed the docs at support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Test-Executions/operation/createTestExecution 

Note that the headers must be correct also.

headers = { 'Content-Type': 'application/json',
  'Authorization': 'Bearer %s' % os.getenv('ZEPHYR_API_KEY','READ FROM ENV')
}
0 votes
Clark Everson
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2023

Hi Rohit,

Welcome to community! While sometimes you may find answers for apps on the community, apps are very much like apps on your phone. So as there are thousands of them you may not find someone that can answer your specific question.

 

I would recommend submitting a ticket to the vendor if you have not already:https://support.smartbear.com/zephyr-squad/

 

Best,

Clark

Suggest an answer

Log in or Sign up to answer