Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Import JUnit xml and update an existing Xray Test

AlterEgo
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!
July 10, 2025

I am running my tests in a jenkins pipeline which produces a junit xml. The xml has my test names like testA, testB etc.

I am importing this into XRAY JIRA data center version, using the REST api. This setup is working if i am trying to create a new Test Execution with the results from the xml.

But my requirement is to update my corresponding manual tests with names like 'Verify ABC, 'Verify BCD' based on the status of the tests testA, testB.

 

I tried to create a mapping like below:

mapping.json

{
"testExecutionKey": "PROJ-5595",
"tests": [
{
"testKey": "PROJ-5414",
"testInfo": {
"name": "testA"
}
},
{
"testKey": "PROJ-5415",
"testInfo": {
"name": "testB"
}
}
]
}
Here is my results file:
results.xml
<?xml version='1.0' encoding='UTF-8'?>
<testsuites name='UITests.xctest' tests='5' failures='5'>
<testsuite name='UITests.AccessibilityTests' tests='5' failures='5'>
<testcase classname='UITests.AccessibilityTests' name='testA'>
</testcase>
<testcase classname='UITests.AccessibilityTests' name='testB'>
</testcase>
</testsuite>
</testsuites>
And this is the API calls i have tried:

curl -H "Content-Type:multipart/form-data" \

-u UN:PWD \

-F "file=@results.xml" \

-F "info=@mapping.json" \

'https://jira.abc.com/rest/raven/1.0/import/execution/junit?testExecKey=PROJ-5595
> This creates new tests

 

 

curl -H "Content-Type:multipart/form-data" \

-u UN:PWD \

-F "file=@results.xml" \

-F "info=@mapping.json" \

'https://jira.abc.com/rest/raven/1.0/import/execution/junit/multipart'

> This throws an error: 

Error assembling issue data: project is required

 

2 answers

Suggest an answer

Log in or Sign up to answer
1 vote
Tuncay Senturk _Snapbytes_
Community Champion
July 11, 2025

Hi @AlterEgo 

Have you tried adding the projectKey to the mapping file?

- endpoint: POST /rest/raven/1.0/import/execution/junit/multipart

- Add projectKey to the mapping.json

{
"testExecutionKey": "PROJ-5595",
"projectKey": "PROJ",
"tests": [
{
"testKey": "PROJ-5414",
"testInfo": {
"name": "testA"
}
},
...
]
}

 

AlterEgo
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!
July 11, 2025

Thank you for the suggestion, unfortunately it didnt help.

Like John Funk likes this
0 votes
Valerie Knapp
Community Champion
July 11, 2025

Hi @AlterEgo , welcome to the Atlassian Community and thanks for your question.

I just wanted to signpost to the product documentation for this https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST  if it can be helpful.

Best wishes

AlterEgo
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!
July 11, 2025

Yes i am using this as my reference. But it doesnt have a lot of examples. I think there is only 1 or 2. Particularly it doesnt cover the scenario of updating an existing test execution using the multipart endpoint.

Like John Funk likes this
TAGS
AUG Leaders

Atlassian Community Events