Ask a Question

how to upload junit test result file to existing test cycle


how to upload junit test result file to existing test cycle

  1.   As of now every time when we upload the junitresult.xml file into the zephyr scale, it creates a new test cycle. but I want to upload it to the existing test cycle and to a specific folder in the same post-call. which is not happening now.
  2.  to customize the test cycle name I am sending the test cycle JSON object along with the junitresultfile.xml but, post-call is ignoring the test cycle JSON object.

below is my request:

  1. import json
    import requests
    def upload_result_to_zyphyr():
    headers = {
    'Authorization': 'Bearer Token'
    params = (
    ('projectKey', 'xxx'),
    ('autoCreateTestCases', 'true'),
    payload = {
    "name": "Sanity",
    "description": "Any additional description can be added here.",
    "jiraProjectVersion": 'null',
    "folderId": 1111111,

    files = {
    'file': open('junitresult.xml', 'rb'),
    data = {'data': json.dumps(payload)}
    response ='', headers=headers,params=params, data=data, files=files)



I am getting a successful response with 200 OK and the result file is getting uploaded into the test cycle but, test cycle customization is not working.


Any suggestion on the above-mentioned points will be really appreciable.


Occasional Visitor


I also have this problem - trying to make a POST request and additional JSON which contains information on test cycle for Zephyr scale is always ignored. 

putting this as another Key "testCycle" in the form-data with value 

"name":"regression overlays",
"description":"regression testing",


trying to following this API doco



get a request back but test cases are not put inside test cycle which suggest JSON part of request is being ignored.

    "testCycle": {
Showing results for 
Search instead for 
Did you mean: