How can I retrieve the build parameters used when a build was triggered in VSTS (using the REST API)? - rest

I'm trying to figure out how to retrieve the build parameters that were used when a build was triggered in VSTS (using the REST API).
I'm successfully retrieving builds using the following query:
https://{accountName}.visualstudio.com/{project}/_apis/build/builds
... but in the response I can't find the parameters that were used.

Just found the parameter key value pairs in the 'parameters' property

Related

How do I use Azure Devops TFS REST API to get older TestRuns of a TestPoint/TestCase/TestSuite?

The API call:
https://dev.azure.com/{organization}/{project}/_apis/test/Plans/{planId}/Suites/{suiteId}/points?api-version=7.0
Returns JSON data with objects "LastTestRun" and "LastTestResult" that contain their Ids. I am trying to find a proper way of getting older (not last) data of TestResults of the given TestPoint using API calls.
I tried the following API call:
https://dev.azure.com/{organization}/{project}/_apis/test/runs?planId=123
That returns me a list of all TestRuns in the given TestPlan. I can loop through the list and make API call for every single TestRun:
https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results
And, then retrieve the TestPointId. The problem is I'm working with large amounts of data, so I'm looping through 7000 API calls and it takes too much time (parallel of course).
I tried calling the last API call with $select so I can retrieve only the TestPointId but it is not supported.
A version of the AzureDevops I am working with: Version Azure DevOps Server 2020 Update 1.2.
Based on your expectation, I have tested as well to get test results with only test point value and tested get the runs of a specific test case in a test suite. Neither succeeded.
Currently there seemed no official API support the test point filter. For this, you may access this URL: https://aka.ms/AzDevOpsIdeas to submit any comments and proposals for future releases and implementations.

get pipeline specific run ID

i am working on azure rest api to get unit test count for specific project, and i found this api inside documents
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=6.0
this gives me all the run id by which i can my unit test results by using another api call
https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runid}/results?api-version=6.1-preview.6
but my problem is my project has multiple test pipeline, is there any way i get pipeline specific run id via passing pipeline id ?
You can try to filter the results returned by the API. For example, when we use Get a list of test runs API:
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?api-version=6.1-preview.3
We can find build id in the result.
We can add buildIds when using queue test runs API:
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&buildIds={buildIds}&api-version=6.1-preview.3
We can find build id and definition id from the result.
You can use below query:
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}/runs/{runId}?api-version=6.0-preview.1
Following are the parameters that you need to specify:
You will get detailed info on this here

How to filter results of an Azure Devops REST API GET request

I am trying to collect some metrics on releases in Azure Devops via a Powershell script.
I have very limited dev experience and am new to PowerShell. And this is the first time I have worked with an API. So far I have been able to authenticate, return a list of releases, loop through them and export the data to a file. Now I need to filter the releases based on a substring of the release name. For the record I have been doing my initial testing in Postman to make sure my syntax and results are correct. Then I migrated working syntax to Powershell.
https://{{organization}}.vsrm.visualstudio.com/{{project}}/_apis/release/releases?api-version=5.0
If I add the id filter as shown here:
https://{{organization}}.vsrm.visualstudio.com/{{project}}/_apis/release/releases?api-version=5.0&releaseId=34567
I get this result:
"id": 34567,
"name": "Test-Release-MyService",
But if use the same filter format for Release Name,
https://{{organization}}.vsrm.visualstudio.com/{{project}}/_apis/release/releases?api-version=5.0&releaseName="Test-Release-MyService"
I get back 50 results of which none match that criteria, whether I wrap the string in quotes or not. Furthermore, what i really want to do is to have the response only include records where the releaseName contains "XYZ".
So the question: Is there a filter operator for "contains" so I only get back records where the release name contains the "XYZ" substring?
Thanks in advance for your advice.
Every parameter you used in Azure DevOps REST API needs to be consistent with the description in the document, Azure DevOps REST API does not support custom parameters. For your question, the parameter searchText is used to filter the the searching result with the release name containing the keyword. I have tested with POSTMAN to call the api, it works fine. In addition, the value of parameter searchText is not case-sensitive. Filter release name
If you want to do more filter, in fact you can use powershell or other client library to deserialize the json response to an object, and do some convert or filter. Following documents may be helpful for you:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-6
https://devblogs.microsoft.com/scripting/playing-with-json-and-powershell/

Is there a way to set only some query parameters from REST API testobject in Katalon Studio

Suppose my REST endpoint supports 5 different query params, How to setup the testcase so as only the required param alone is sent .
I have created the REST service in Object respository defining all query params. (None of them are mandatory)
I want to write testcases for this with different parameter/value combinations.
Is this possible in katalon studio?

How do i get all values from a global pick list in salesforce using REST Api?

I know i can get the values of the picklist via a call to describe an object.
Is it possible to get the values without adding the field to an object and to query the values regardless of the object it is used in?
Is it possible to do the same with GlobalValueSets? According to the documentation they are used since API 38.0 and later.
Since API 39.0 it is possible to access GlobalValueSets through the Tooling API. It is possible to access the GlobalValueSet without adding the field to an object.
The following REST call should be used:
GET /services/data/v39.0/tooling/sobjects/GlobalValueSet/{ID}
Where the ID can be found in SalesForce > Global Value Set > The Global Value Set you wish to access via the API > Grab the ID from the URL.