Using Xray API to import cucumber test results - 404

Joao Campos February 18, 2020

I am trying to use the Xray REST API to update test executions for Cucumber tests.

When I run:

curl -H "Content-Type: application/json" -X POST -u username:apiToken --data @e2e/reports/results.json https://companyName.atlassian.net/rest/raven/1.0/import/execution/cucumber

 All I get is a 404 error message with this response:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: https://companyName.atlassian.net/rest/raven/1.0/import/execution/cucumber</message></status>

Could I be missing additional parameters or is my URL malformed in any way?

Thank you
Joao

3 answers

1 accepted

0 votes
Answer accepted
Joao Campos February 18, 2020

Resolved. Somehow I missed the updated API docs with different hostname and API endpoint available at https://confluence.xpand-it.com/display/XRAYCLOUD/Import+Execution+Results+-+REST

I was able to authenticate and generate a token which I used to update my tests. This ticket can be closed.

Thank you
Joao

rgnair June 4, 2020

Not worked still getting the 404 page 

curl -H "Content-Type: application/json" -X POST --user user@gmail.com:apitoken --data @"*****/cucumber.json" https:/******/api/v1/import/execution/cucumber

rgnair June 4, 2020

@Joao Campos  any idea how to resolve

0 votes
Kirsten Langendorf
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!
August 25, 2020

I am also getting the same response/error using the 

curl -H "Content-Type: application/json" -X POST -u username:apiToken --data @e2e/reports/results.json https://companyName.atlassian.net/rest/raven/1.0/import/execution/cucumber

If I use the referred in the answer above I get   - e.g. for exporting the all the tests in my project (=filter 10508). I have made a variable called token that contains my client id and the client secret (concatenated).

curl -H "Content-Type: application/json" -X GET -H "Authorization: Bearer $token"  "https://xray.cloud.xpand-it.com/api/v1/export/cucumber?filter=10508"                          

{"error":"No Cucumber Tests were found when exporting"}%   

Any idea how to resolve? 

Deleted user May 19, 2021

Please check the tags used in the feature file.

They should be same as in the jira cloud.

For example: if you created a test type with jira key id TEST123, and you are tagging as TEST_123 in the feature file, this error can occur.

Try to remove all special characters like underscores, etc and keep limited to alphabets and numbers.

 

This way I resolved my issue.

0 votes
CrazyAs5assin July 15, 2020

Any luck? I am struck with the same issue now

Kirsten Langendorf
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!
August 25, 2020

I have the exact same problem. I guess it is correct to write https:// and not http:// as stated in the documentation:

curl -H "Content-Type: application/json" -X POST -u admin:admin --data @cucumber_output.json http://yourserver/rest/raven/1.0/import/execution/cucumber

 

using http:// doesn't do anything.

Raghavendra Patlolla
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!
May 18, 2023

I am facing the same issue. Importing the file manually in Jira works but trying with the REST API gives me 404. Any idea how to resolve this issue? @Joao Campos @Kirsten Langendorf 

Suggest an answer

Log in or Sign up to answer