How to upload xml test result to JIRA uses XRAY plugin.

Pavankumar April 1, 2024

Hello Team 

Earlier I used below command to upload robot test result successfully to jira uses xray plugin 

curl -H "Content-Type: multipart/form-data" -u user:passwd -F "file=@output.xml"

Recently, My jira server moved to cloud and url got changed to  then i changed the rest api command to 
curl -H "Content-Type: multipart/form-data" -u user:passwd -F "file=@output.xml"

But the result is not getting uploaded and results in failure as below :

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Oops, you&#39;ve found a dead link. - JIRA</title><link type='text/css' rel='stylesheet' href='/static-assets/metal-all.css' media='all'><script src='/static-assets/metal-all.js'></script><meta name="decorator" content="none" /></head><body class=" error-page error404"><script type="text/javascript">document.body.className += " js-enabled";</script><div id="page"><header id="header" role="banner"></header><!-- #header --><section id="content" role="main"><div class="aui-page-panel"><div class="aui-page-panel-inner"><section class="aui-page-panel-content lowerContent"><div id="error-state"><span class="error-type"></span><h1>Oops, you&#39;ve found a dead link.</h1><ul><li>Go back to the <a href="javascript&colon;window.history.back()">previous page</a></li><li>Go to the <a href="/secure/MyJiraHome.jspa">Home Page</a></li></ul></div></section><!-- .aui-page-panel-content --></div><!-- .aui-page-panel-inner --></div><!-- .aui-page-panel --></section><!-- #content --><footer id="footer" role="contentinfo"><section class="footer-body">

<ul class="atlassian-footer">
Atlassian JIRA <a class="seo-link" href="">Project Management Software</a>


<span id="footer-build-information">(v1001.0.0-SNAPSHOT#100248-<span title='d2a8619c534a6b3769f470bb97e8df1ebd06aed7' data-commit-id='d2a8619c534a6b3769f470bb97e8df1ebd06aed7}'>Rev:d2a8619</span>)</span>
<a id="about-link" href="/secure/AboutPage.jspa">About JIRA</a>
<a id="footer-report-problem-link" href="/secure/ContactAdministrators!default.jspa">Report a problem</a>
<div id="footer-logo"><a href="" rel="nofollow">Atlassian</a></div></section></footer><!-- #footer --></div><!-- #page --></body></html>

Please suggest is there any changes required in the uploading api command or any other.

1 answer

0 votes
Pavankumar April 7, 2024

create a token using xray client id and secret key and export it as shell variable.
Use curl -H "Content-Type: text/xml" -X POST -H "Authorization: Bearer $token" --data @"output.xml"

to upload test result to JIRA.

Suggest an answer

Log in or Sign up to answer