Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to add an attachment to each Test Step in XRAY REST API Edited

Hi team,

https://docs.getxray.app/display/XRAYCLOUD/Importing+Tests+-+REST+v2

Document just mentions to how to upload fields action, data, result to each test step in Test. How about with field "attachment" in each test step, Do you support this?Screen Shot 2021-07-12 at 10.14.23.pngScreen Shot 2021-07-12 at 10.15.54.png How to add an attachment/picture to each Test Step with XRAY REST API (XRAY CLOUD)?

Thanks,

Hoi

 

1 answer

1 accepted

Hi @Hoi Tran 

You need to use GraphQL (https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API) and the mutation  updateTestStep (https://xray.cloud.xpand-it.com/doc/graphql/updateteststep.doc.html).

As an input, you have the object UpdateStepInput where you can set the Attachment.

Any additional questions, please get in touch with Xray Support (http://xraysupport.xpand-it.com); we would gladly assist you.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Hi @Rogério Paiva - Xray Xporter ,

Thanks for your response. However, I don't think that answers my question.

As your guideline, to use GraphQL, we need to use Insomnia with GUI.

In this case, I need some APIs (script) to automatically upload test steps (include data, image, attachment) to Xray TEST type. Does XRAY support this?

Thanks,

Hoi

Hi @Hoi Tran 

No, the GraphQL does not require Insomnia, we suggest this tool to test the API, but it is not mandatory. You can make GraphQL requests similar to REST API requests inside code/scripting; it is only necessary to respect the GraphQL request format.

GraphQL still executes over an HTTP protocol, just like other API requests.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Like Hoi Tran likes this

@Rogério Paiva - Xray Xporter Great! That what I am looking for. Thanks so much.

Do you have any examples for that, eg. for authentication like REST API?

I referred your link: http://xraysupport.xpand-it.com

but just see:

Screen Shot 2021-07-30 at 16.19.52.png

Do I need to raise a question to that page?

Thanks,

Hoi

Hi @Hoi Tran 

That link is for the support service desk, and yes you may raise a question there.

Nevertheless, here are the documentation links to the authentication:

https://docs.getxray.app/display/XRAYCLOUD/GraphQL+API

Requests made to Xray's GraphQL API must also be authenticated using the same endpoint for REST API authentication.

Thank you.

Kind regards,
Rogério Paiva [Xray Support Team]

Like Hoi Tran likes this

@Rogério Paiva - Xray Xporter Thanks so much for your support.

I found the HTTP request form what you mentioned to:

https://graphql.org/learn/serving-over-http/ 

GET:

http://myapi/graphql?query={me{name}}

POST:

{
"query": "...",
"operationName": "...",
"variables": { "myVariable": "someValue", ... }
}

Thanks,

Hoi

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you