getting XRAY steps with API

Demiank100 August 17, 2020

i would like to get the steps done in an xray issue,   so later on i can modify them i am following the documentation from https://docs.getxray.app/display/XRAY/Test+Steps+-+REST

 and using 

https://my_site/rest/raven/1.0/api/test/TES-3/step  but my responds is 404  

i created an API TOKEN that i can use in the normal Jira api calls, for example if i do 

https://my_site/rest/api/2/issue/TES-3 and do get a json with information, but looks like in the directory doesn't have the information of the steps, or the other precondition, test sets etc...  so i went to look for the xray API, but they say that is also basic that i can use jira API, .... i am missing something? xray does have a different authorization?  i am using the free version not sure if that might have restrictions?  

 

thanks guys =?

1 answer

0 votes
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.
August 17, 2020

Hi @Demiank100 ,

it seems you're looking at Xray Server (on Jira server) documentation. 

The proper documentation for Xray Cloud is this one: https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API

 

It requires you to use the GraphQL API, which is the correct API for that in cloud.

You can see some usage examples in the postman collections available in this open-source project :)  - https://github.com/Xray-App/xray-postman-collections

Regards

Sergio

Demiank100 August 17, 2020

thanks Sergio,  i was able to create my API on the xray application(not Jira, that is a diferent thing and maybe that what i was having confuse to begging with), and did a rest api to 

https://xray.cloud.xpand-it.com/api/v1/authenticate

with my cliend_id and my client_secret, got 200 and got the token =)

 

but now? what do i do?  how can i retrieve for example the steps on an issue? or update them?

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.
August 18, 2020

I would highly recommend you to have a look at the postman collections that I've shared with you as it provides concrete examples :)

Here is an example of a GraphQL request for that:

 

HTTP GET request to https://xray.cloud.xpand-it.com/api/v1/graphql with the body content

{ getTest(issueId: "1234") { steps { id data action result attachments { id filename } } }}

 

you need to know the issueId (it's not the issue key) though. For that you need to either obtain it from the Jira HTTP issue creation request.. or you need to make a Jira HTTP request for that. For the former, I've an example in the postman collection under GraphQL>tests>create folder. For the later, you can see here: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get

Note: the GraphQL documentation is somehow interactive; it also provides usage examples.

Like Sefik Bayar likes this
Demiank100 August 19, 2020

thanks for posting the git https://github.com/Xray-App/xray-postman-collections  with those examples, they are great  (and easier to follow that the xray documentation =)  thanks,  got it working.

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.
August 19, 2020

you're welcome :) it took me a while to prepare them but I think they help in cases like this ;)

Sérgio

Demiank100 August 21, 2020

they SUPER HELP!!!!

Like Sergio Freire - Xblend likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events