The TFS Rest API allows me to get a specific Release for a Team Project
Ex. https://bla.visualstudio.com/MySuperProject/_apis/release/releases/666
I already found, how to get the related Pool of the Release. But is it possible to retrieve the Agent where the Release was deployed using the TFS Rest API ?
Thanks
You can get the release with all the details by calling REST API as shown below. You should use youraccount.vsrm.visualstudio
https://yourVSTSAccount.vsrm.visualstudio.com/yourproject/_apis/release/releases/releaseid
example
https://myac.vsrm.visualstudio.com/Project%20X/_apis/release/releases/106
gives the release agent in deployment steps as shown below
Related
We are trying to use Microsoft Azure DevOps API and retrieve following information for each build under each project in Azure DevOps organization. Ultimate goal is to retrieve these datils using C# code and use as a data to make some decisions in one of our dashboard. As we can see, these details available in the summary of the build once build completed (in Azure DevOps build summary page).
Unit Test Status
Code Coverage
Build Status
Deployment Status
Automated Test Execution Status
We have referred this Microsoft official documentation in our research. And found that below GET methods has some information that may help with our research, but unfortunately these does not contains all the information that we are looking for.
Build
Builds
History
Could someone help us by recommending possible candidate API's to efficiently extract this data?
I am developing an extension for Azure DevOps. Details of my extension are as below
Supported environment
Azure DevOps
TFS 2017
TFS 2018
DevOps server 2019
DevOps server 2020
Language: Typescript
Contribution Points :
ms.vss-distributed-task.task
ms.vss-releaseManagement-web.release-summary-tab
Scopes :
vso.build
vso.build_execute
vso.work_write
vso.release
vso.release_execute
My task is running in the release pipeline and generates some data. I want to pass these data to the release tab once the release is completed. And display some arranged information in the release tab. further user should able to view information related to a particular old release in the tab by navigating to that relase as well.
Please be kind enough to provide some guidelines for achieving this task. Please let me know if you need any additional information.
Here are two ideas for getting data from release pipeline:
Present the data you need in the task's running log and then use REST APIs to get the log. Here are several REST APIs:
Releases - Get Task Log: This REST API can get log of a specific task, which only supports plain texts.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version=6.0-preview.2
Releases - Get Logs: This REST API download a zip file that contains log of all the tasks.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/logs?api-version=6.0-preview.2
Write the data you need to a file and then use Copy Files task to get the file outside the release.
I need to know which projects are part of a changeset for a specifc build using the VSTS API 2018. The REST api doesn´t seem to support getting a changeset based on a buildId. https://learn.microsoft.com/en-us/rest/api/vsts/tfvc/changesets/get
Is it possible to get a changeset based on a build ID?
Yes. You're looking at the wrong area of the documentation.
Ref: https://learn.microsoft.com/en-us/rest/api/vsts/build/builds/get%20build%20changes
GET
https://{accountName}.visualstudio.com/{project}/_apis/build/builds/{buildId}/changes?api-version=4.1
That gets you the changes associated with a build. If you want to get more details on the changesets from there, you can retrieve the specific changesets using the API you've already discovered.
I am using the TFS2018 api and I need to get the build agent id for different team projects. How can I get the list of agent queue ids using the TFS sdk?
This is well-documented.
GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/Fabrikam-Fiber-Git/_apis/distributedtask/queues?api-version=3.0-preview.1
I have a requirement to assign a VSTS bug item to be fixed in next release using VSTS Rest API. I'm assuming "Microsoft.VSTS.Build.IntegrationBuild" is the field to update with next release version. However this field is not available in VSTS bug item UI(Build and test integration field reference). I also need to retrieve the next release information for the project via VSTS API, Is it possible to do this with current VSTS Rest API? Please advice.
Thanks in advance.
There isn’t the REST API to link bug work item to release. Also, we can’t to do it through UI (e.g. web access)
The work item be linked to the build can be track in the release. So you can link work item to changeset (REST API or manually), then the build associate to this changeset will associate that work item.