Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Failed to import test execution results. Status code: 400 Response: {"error":"Error creating issues

I have written the following python code:

import requests
import json
import os

xray_cloud_base_url = ""
client_id = provided
client_secret = provided

# endpoint doc for authenticating and obtaining token from Xray Cloud:
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
auth_data = { "client_id": client_id, "client_secret": client_secret }
response ='{xray_cloud_base_url}/authenticate', data=json.dumps(auth_data), headers=headers)
auth_token = response.json()
with open('sample.xml', 'r') as file:
junit_xml_content =

# Prepare headers
headers = {
'Authorization': 'Bearer ' + auth_token,
'Content-Type': 'application/xml',
'X-Info-JSON': json.dumps({
"fields": {
"project": {
"key": "DX"
"summary": "Test Execution for JUnit tests",
"description": "This contains test automation results",
"components": [{"name": "QA"}],
"issuetype": {
"name": "Test Execution"

# "fixVersions": [{"name": "v1.0"}]

url = f'{xray_cloud_base_url}/import/execution/junit?projectKey=DX&testExecKey=DX-79900'
response =, headers=headers, data=junit_xml_content)

# Send the POST request
# response ='{xray_cloud_base_url}/import/execution/junit', headers=headers, data=junit_xml_content)

# Process the response
if response.status_code == 200:
print('Test execution results successfully imported.')
print(f'Failed to import test execution results. Status code: {response.status_code}')
print(f'Response: {response.text}')

Failed to import test execution results. Status code: 400
Response: {"error":"Error creating issues in Jira! - components: Components is required."}

I have given the right component name as i have matched with JIRA ticket.

0 answers

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events