Import Junit results to Xray returns 404

yael berman January 5, 2020

Hi, 
I want to import junit results to Xray by api.
I try to do it by postman, and these are my details: 

  1.  I do POST request to the follow URL:https://MY_JIRA/rest/raven/1.0/import/execution/junit?testExecKey=MY_TEST_EXEC_ID
  2.  In  "Autherization" section I choose "Basic Auth",
    in user name field: I insert my mail. 
    in password: I insert my API token 
  3. In  headers sections:
    I choose "Content-Type" and fiil "text/xml"
  4. In body section: 
    I choose in "key" the file option, and in "value" I choose my file of results (XML format).

    But I get:
    Status code: 404 - not found,
    message: null for URI: https:// XXXXX
    See the attachments.

    I tried to do it by CURL, but same error....


    Thanks in Advance!!!


    The URL: 

‏‏URL.PNG

 

The Body: 
‏‏body.PNG

 

The Authorization: 

‏‏headers.PNG

The results: 

‏‏results.PNG

2 answers

1 vote
Cristiano Mariano
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 5, 2020

Hi @yael berman How are you doing?

Welcome to the community!

As you are using Jira Cloud, you would have to make things in a different way.

First of all, you cannot use Basic Authentication. You would have to generate an API Key (Client Id and Client Secret) in your Jira instance and then use it to make a call to XRay's Authentication Rest API. It will return a token to will that you will use in your second call. 

As far as I understood, it is important to notice that you have to call the APIs that are exposed by Xpand-IT. You don't have to change the address to your domain. Based on your API Key, they will know what Jira instance they will have to affect.

The URL for authentication is: https://xray.cloud.xpand-it.com/api/v1/authenticate

The URL for Junit Import is: https://xray.cloud.xpand-it.com/api/v1/import/execution/junit

These are other links to their Cloud API documentation:

https://confluence.xpand-it.com/display/XRAYCLOUD/REST+API

https://confluence.xpand-it.com/display/XRAYCLOUD/Authentication+-+REST

https://confluence.xpand-it.com/display/XRAYCLOUD/Continuous+Integration+Tools

Hope this helps!

yael berman January 24, 2020

Thanks you for your reply, 
It really helped me and solved the 404 issue. 
But now Im getting 400.  "error": "Missing data in the junit results import request"
Any idea how to solve it?

daisy.shan March 10, 2020

Same issue in my side. Have any idea how to solve it?

daisy.shan March 15, 2020

When I used binary instead of form-data, this issue is solved.

Postman 2020-03-16 10-11-27.png

0 votes
José Domingues [Xray]
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
January 10, 2020

Hi Yael, 

 

Can you please open a support ticket in our Portal

We'll need more information to better address the question.

 

Best Regards,

Team Xray

Suggest an answer

Log in or Sign up to answer