Error: Invalid xml file: Unexpected close tag while importing xml results to JIRA XRAY

Pavankumar
Contributor
July 17, 2023

Generated an authentication token using client ID and Secret key and trying to import robot xml results to JIRA using rest api but results in invalid xml file.

Log:

cmd:  curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token" --data @"output.xml" https://xray.cloud.getxray.app/api/v2/import/execution/robot?projectKey=GOP
{"error":"Invalid xml file: Unexpected close tag Line: 0 Column: 1291 Char: >"}

xmllint doesn't show any errors.

cmd:  xmllint --noout output.xml

Please let me know, How to resolve it?

1 answer

1 accepted

0 votes
Answer accepted
Pavankumar
Contributor
September 13, 2024

Answering Lately, 
I found its the xml file format issue.

run cmd: xmllint --format output.xml  

generates proper format. save it and run the curl cmd to import/export result to jira.

Suggest an answer

Log in or Sign up to answer