xray on Jira create test execution through api

gilc
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!
February 16, 2020

I am using Jira cloud and I installed the Xray add-on.

how can I get the API location? 

 /rest/raven/1.0/api/testexec/{testExecKey}/test

its look like i don't have the raven path

2 answers

2 votes
Diego Mesa
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!
October 17, 2023

Hello, 

I've been struggling with this for a few days, with the creation and the import of test executions results, 

Finally I have the answer, there isn't a raven path with JIRA and XRAY.

I have this JIRA url: https://myprojectoftest.atlassian.net/

If you have JIRA with the Xray Plugin installed then you need to:


1. Create the XRAY API keys (inside the JIRA platform).

2. Since XRAY is a plugin, that connects to JIRA try this: 

curl -H "Content-Type: application/json" -X POST -H "Authorization: Bearer $token" --data @"data.json" https://xray.cloud.getxray.app/api/v2/import/execution

IMPORTANT NOTE:
As I'm writing this answer on the date 17-10-2023, the are two API:

1. The JIRA API, an example of this is:
https://myprojectoftest.atlassian.net/rest/api/latest/issue/CALC-16
where CALC-16 is the ID of an issue. If put this in your browser you would see a JSON, this would be a GET request to JIRA.


2. THE XRAY API:
https://xray.cloud.getxray.app/api/v2/import/execution

this worked for me, I could import test executions results with the data.json format of XRAY.

and the $token would be a variable in shell:
token=$(curl -H "Content-Type: application/json" -X POST --data @"cloud_auth.json" https://xray.cloud.getxray.app/api/v2/authenticate| tr -d '"')

where your cloud_auth.json is:

{ "client_id": "XXXXXXXX","client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX" }


this connects to the direct API of XRAY, with the keys created earlier (client_id,client_secret), and then modifies your test executions results in JIRA.


An example for the creation of a test execution, would be: 
data.json:

{
"info" : {
"summary" : "Creation of Execution of automated tests for release v1.0",
"description" : "This execution is automatically created when importing execution results from an external source",
"version" : "v1.0",
"user" : "youruser@gmail.com",
"revision" : "1.0.42136",
"startDate" : "2014-08-30T11:47:35+01:00",
"finishDate" : "2014-08-30T11:53:00+01:00",
"testPlanKey" : "CALC-18"
},
"tests" : [
{
"testKey" : "CALC-46",
"status" : "TO DO"
}
]
}

this would create an issue of test execution from the test plan CALC-18, with the test CALC-46.
if you want to import the results the data.json would be:


{
"testExecutionKey": "CALC-51",
"info" : {
"summary" : "Execution of automated tests for release v1.0",
"description" : "This execution is automatically created when importing execution results from an external source",
"version" : "v1.0",
"user" : "youruser@gmail.com",
"revision" : "1.0.42136",
"startDate" : "2014-08-30T11:47:35+01:00",
"finishDate" : "2014-08-30T11:53:00+01:00",
"testPlanKey" : "CALC-18"
},
"tests" : [
{
"testKey" : "CALC-46",
"start" : "2014-08-30T11:47:35+01:00",
"finish" : "2014-08-30T11:50:56+01:00",
"status" : "FAILED",
"evidence" : [
{
"data": "/9j/4AAQSkZJR.....(base 64 encode)",
"filename": "screenshot_2.jpg",
"contentType": "image/jpeg"
}
],
"comment" : "Failed execution"
}
]
}
.

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.
June 4, 2020

Hi, @gilc ,

You can look to our support documentation regarding the topic: 

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

Best Regards,

Team Xray 

roei_sabag
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!
September 21, 2020

Hi there, Team XRay.

I am sorry to say, but this is not an answer.

I am facing the same problem.

 

XRay support documentation? Where? It is very confusing. I cannot find a clear answer nor example on XRay cloud using raven!

 

Can you please give clear answers gor the folowing?

1. Is Raven path exists on Jira cloud + XRay (yes/no)?

2. If not, is there a reasonable replacement? The APIs in the link you have provided are very limited.

3. If yes, why we get 404 response? (which works fine on the non-cloud version)

Like # people like this
Sergio Freire - Xblend
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.
October 19, 2020

Hi @roei_sabag

For better guidance, you'll need to provide more information so I recommend you reach out Xray support and the team will be glad to help you out.

Best Regards, 

 

Sérgio

_______

Solution Architect and Testing Advocate @Xray

Personal blog on testing, Agile and software development: https://sergiofreire.com

Follow me on Twitter: https://twitter.com/darktelecom

Rhino API
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!
November 18, 2022

Thanks, but no thanks.

 

Your support is less than worse. I will make it short for the sake of other people arriving here.

 

1. Raven is not supported on XRay cloud.

2. There is no replacement.

3. The new API is called xpandit and it is limited on its public version.

 

In order to migrate our customers with full functionality to XRay cloud we had to use a serious voodoo which cost us a significant decrease with performance (200%+).

 

You can check how we did it here

https://github.com/savanna-projects/rhino-connectors-atlassian

 

Whom ever can, change to Azure Test Manager or TestRail (they have the best and most reliable API).

 

The ones who really insist to work with Atlasian (god knows why) - Qmetry is a much better alternative

dmccarter
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!
February 5, 2023

I've been searching for ages for this answer too. No information at all to suggest that Raven is not supported in Cloud ANYWHERE on the internet apart from this query.

 

This is so poor and I'm shocked with Atlassian, I expected much better for something we pay for ...

Des

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events