Ask a Question

How can I update test results using API to a specific cycle phase? (Pytest)

Frequent Visitor

How can I update test results using API to a specific cycle phase? (Pytest)



New to Zephyr here. I have a test cycle and phases already created through the web UI. Each phase has test cases added to them. How can I use the API to post results to update the test status for the testcases in the phases? 


The tests I am running are automated through Pytest running on many different test machines, I am looking for a way to POST or PUT many test results at once either by providing a payload that Zephyr can read in. Assuming Pytest knows the testcase id.


I do see the API endpoint /execution/bulk to Execute cases in bulk but not sure where to get the parameters to pass in, or how to format the body.

What is `scheduleids` ? There are also an `ids` in the JSON body as well in the example. 


Any help would be great!


Occasional Contributor

Hi @gqdabien ,

You can create Junit XML reports using this method:

Then use Zephyr test executions - upload JUnit XML API 


I created a py script that uploads multiple XML files to Zephyr, after editing them in such a way that when the test cases are automatically created (if they don't exist) their name will include just the test method name, without the full package and class names, making it more readable in Zephyr.

Just change the script locally to point to the right xml files folder.

The script can be found here: 

You will need to create an API token so you can use it. Create one here: The token should be passed as a '--token <tokenId>' to the script.

Showing results for 
Search instead for 
Did you mean: