I'm working on importing Junit XML file that i generate with my tool Cypress , and i looking for importing all test cases insides ti Jira Xray by using command CURL
I tried so many input like :
curl -H "Content-Type: multipart/form-data" -u user:pwd -F "file=@test-results.xml" https://jira.fr/rest/raven/1.0/import/execution/junit?projectKey={somekey}
curl -H "Content-Type: multipart/form-data" -u user:pwd -F "file=@test-results.xml" https://jira.fr/rest/raven/1.0/import/execution/junit/multipart?projectKey={somekey}
curl -H "Content-Type: multipart/form-data" -u user:pwd -F "file=@test-results.xml" https://jira.fr/rest/raven/1.0/import/execution/junit?testExecKey={somekey}
curl -H "Content-Type: multipart/form-data" -u user:pwd -F "file=@test-results.xml" https://jira.fr/rest/raven/1.0/import/execution/junit/multipart?projectKey={somekey}&testExecKey{somekey}
I got always those responses :
{"error":"org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found"}
{"error":"The Test Execution info file is required."}
is there new methode to make that works please ?
Hi @[deleted]and welcome to the community,
multipart import takes an xml with a json.
Did you try to use „Content-Type: text/xml“?
BestStefan
yes , i did . It returns nothing . and when i go to my Test Excution Task in Jira , i find that any tests was imported .
this my command :
curl -H "Content-Type: text/xml" -u user:pwd -F "file=@test-results.xml" https://jira.fr/rest/raven/1.0/import/execution/junit?testExecKey=SC-{someKey}
Hi @[deleted],
it seems your call is missing the method (POST). This is a call I used succeessfully in the past:
curl -H "Content-Type: text/xml" -X POST \-H "Authorization: Bearer ${{ secrets.XRAY_TOKEN }}" \--data @./cypress/test-results.xml https://xray.cloud.getxray.app/api/v2/import/execution/junit?testExecKey=${key}
.
It looks like you're new here. Sign in or register to get started.