Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,107
Community Members
 
Community Events
168
Community Groups

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

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
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