error: Missing data in the junit results import request

huaqin.xia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 9, 2023

Hi, I'm trying to import JUnit test result(report.xml) to a specific Test Execution ticket(already created before importing), but I always get {"error":"Missing data in the junit results import request"}, can you please help check and let me know what data is missing in the request?

The Junit test report(report.xml) contains 2 test results, both results contain the test_key(MYPRJKEY-17393 and MYPRJKEY-23474), which are the existing xray Test ticket in Jira.

The curl command I used is as following

curl -H "Content-Type: multipart/form-data" -X POST -H "Authorization: Bearer eyJhb***ffYmCoCLnI" -F "file=@report.xml" https://xray.cloud.getxray.app/api/v1/import/execution/junit?projectKey=MYPRJKEY&testExecKey=MYPRJKEY-12345

The bearer token is valid, MYPRJKEY is the project key, all the tickets in my project start with "MYPRJKEY-", and "MYPRJKEY-12345" is an existing Xray Test Execution ticket, and content of report.xml is as following

<testsuites id="" name="" tests="2" failures="0" skipped="0" errors="0" time="130.86764">
<testsuite name="component\testComponent.MainFile.spec.ts" timestamp="2023-10-10T01:38:43.964Z" hostname="chromium" tests="2" failures="0" skipped="0" time="128.405" errors="0">
<testcase name="MYPRJKEY-17393 Add Main file" classname="component\testComponent.MainFile.spec.ts" time="79.765">
<properties>
<property name="test_key" value="MYPRJKEY-17393">
</property>
</properties>
<system-out>
<![CDATA[Clicking disclaimer "accept" button
Clicked on the disclaimer "accept" button
Test document name: test_1111
addDocument test_1111
]]>
</system-out>
</testcase>
<testcase name="MYPRJKEY-23474 User Preference settings" classname="component\testComponent.MainFile.spec.ts" time="90.765">
<properties>
<property name="test_key" value="MYPRJKEY-23474">
</property>
</properties>
<system-out>
<![CDATA[Clicking disclaimer "accept" button
Clicked on the disclaimer "accept" button
set preference successfully
set preference successfully
set preference successfully
]]>
</system-out>
</testcase>
</testsuite>
</testsuites>

 

1 answer

0 votes
Aron Weiler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2024

Did you ever find a solution to this?  I am running into the same issue, and my test XML looks nearly identical.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events