How to authenticate for xray internal API

Reyhan Sadak
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, 2023

Hello,

Here is my use case: I need to reset the status of test runs (to become TODO) at the beginning of the tests exection in a batch requests ( I want to avoid setting the status one by one with the graph QL API updateTestRunStatus).

I reverse engineered the request Jira make when multiple test runs are selected from the test execution and it is a POST request to: https://xray.cloud.getxray.app/api/internal/testruns/status

I try to make the same request and I pass "Authorization" header to "Bearer <access_token>" but I get the response: {"error":"Authentication request has expired. Try reloading the page."}

I know that this is an internal API, but if Jira uses it, why can't we? This will save us 99 additional requests as it seems that the maximum number test runs is 100.

1 answer

1 accepted

0 votes
Answer accepted
Reyhan Sadak
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 4, 2023

I managed to achieve what I wanted using this API
https://docs.getxray.app/display/XRAYCLOUD/Import+Execution+Results+-+REST+v2
Adding all tests in the requests with status "TO DO".

I hope that this could help someone who tried what I did.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events