REST API: Query list of Test Environments for a given Test Plan
Hi,
Given a Test Plan URL, I'd like to obtain list of associated Test Environments, with URL and Name for each Test Environments.
I know I can do it this way:
- GET /testplan/id to obtain list of test env URLs
- for each test env URL, get /configuration/id to obtain its name
However, this requires N HTTP requests just to obtain the name, I'd like to minimize amount of HTTP requests. Is there any better ways?
Note: I tried to peek at internal API, and can do the following to obtain list of test env Names of given testplan:
- GET ITestConfigurationRestService?configurations?testplanUUID=xxx
However, the test env URL is not exposed in the API.
Accepted answer
The URL for the Test Environment artifact is constructed by the client side script, based on the response of the ITestConfigurationRestService request. You will need to "id" (UUID) and "/Assets/AssetInstance/AssetType/name" to construct the URL for the test environment. Note that this is the web URL, not REST API.
I haven't found a way to show the id and the name of the test environment when querying the test plans using REST API either.
I haven't found a way to show the id and the name of the test environment when querying the test plans using REST API either.