def upload_junit_xml(token, project_key, file_path):
headers = {
'Authorization': f'Bearer {bearer_token}',
}
files = {
'file': (file_path, open(file_path, 'rb'), 'application/xml')
}
try:
response = requests.post(url, headers=headers, files=files)
response.raise_for_status() # Raise an exception for any HTTP error status
print("Request successful. Response:")
print(response.json())
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
# Replace 'YOUR_TOKEN' with your actual token
file_path = xml path
After running above code, it will create a new test cycle and update status of all test cases Pass or Fail. but what i want is it should update existing test cycle and should not create new test cycle.