Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the REST API to find the Test Run ID without knowing Test Exec Key?

Lindsay Herron September 20, 2022

With testrun issue types, there are two statuses:

  1. Issue Status: In Use, Accepted, Rejected, ...
  2. Test Run Status: PASS, FAIL, ABORTED, ...

With ONLY the testrun key (no testexec key), so TEST-123, how can I change the testrun status? Or find the ID of the issue.

How to achieve it in the end is simple via PUT, but it requires me knowing the issue ID already:

.../rest/raven/1.0/api/testrun/<issueID>/status?status=<statusTYPE>

  • where <issueID> is the ID of the TEST-123 issue
  • <statusTYPE> is PASS, FAIL, ABORTED, ...

As for the header, I would only need:

headersStatus = {
            "Authorization": "Basic " + self.user_password,
            "Content-Type": "application/json",
        }
Missing information is then only the issueID.

1 answer

1 accepted

0 votes
Answer accepted
Lindsay Herron September 21, 2022
Solved the issue ourselves:
link = r".../rest/raven/1.0/test/{testRunKey}/testrun"
With GET, returns a dictionary with an "entries" key.
"entries" contains the test execution information and the testRunId.

Suggest an answer

Log in or Sign up to answer