azure-devops-rest-api

Having no permission for updating Variable Group via Azure DevOps REST API from running Pipeline

馋奶兔 提交于 2021-01-27 13:25:52
问题 In a nutshell, I am trying to update a Variable Group when executing a PowerShell script from a build Pipeline (increasing a build number, but this part is not so important). As it suggested in this topic and Azure DevOps docs I use code similar to: $url = "$($env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)$env:SYSTEM_TEAMPROJECTID/_apis/build-release/definitions/$($env:SYSTEM_DEFINITIONID)?api-version=2.0" Write-Host "URL: $url" $pipeline = Invoke-RestMethod -Uri $url -Headers @{ Authorization =

Azure DevOps get commits linked to a work item via the REST API

ⅰ亾dé卋堺 提交于 2021-01-27 06:36:49
问题 Is there a way to get Git Commits that are linked to a work item given only the work item ID? I'm using PowerShell and this URI to get work items, but I don't see any of the linked commits on the returned object. I also don't see any documentation on how to get these links. $Results = Invoke-RestMethod -Uri "http://azuredevops/azuredevops/Collection/Project/_apis/wit/workitems?api-version=5.1&ids=1" -Method "GET" -UseDefaultCredentials | Select-Object -ExpandProperty Value $Results.fields 回答1

How to add an existing Area to an existing Team?

家住魔仙堡 提交于 2021-01-16 04:19:18
问题 I have an Area that I've created using the SDK, and I have a Team. How can I, using the SDK, add that Area to the Team? It's simple enough to do so with an Iteration, using the WorkHttpClient.PostTeamIterationAsync() method (code below), but there's no corresponding method available to do the same with an Area. I looked briefly at the method's source code, but it contains a GUID indicating the target location (Iterations). If I can avoid it, I'd rather not risk getting down to that level by

TFS 2017+, C#, set Default Area

自闭症网瘾萝莉.ら 提交于 2021-01-07 03:01:51
问题 I am working on creating a team in TFS using C# and the dll's provided. I'm having a hard time setting the default Area and could use some help. VssCredentials vc = new VssCredentials(true); TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(TFS_CONNECTION_URL), vc); tpc.Authenticate(); TfsTeamService teamService = tpc.GetService<TfsTeamService>(); ProjectInfo projectInfo = cssService.GetProjectFromName(TEAM_PROJECT_NAME); TeamFoundationTeam team = teamService.CreateTeam

devops REST API: can not update work item status using PATCH method

杀马特。学长 韩版系。学妹 提交于 2021-01-05 14:38:04
问题 I am using DevOps restapi to get some information. The POST method is working fine for me. I want to update the status of my work item. For that I need to use the PATCH method. Which is not working, and not giving any kind of error. https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.1 function postApiData(ApiUrl, responseBody) { var res = ''; try { $.ajax({ type: 'POST', async: false, url: ApiUrl, contentType: 'application/json', data: JSON

devops REST API: can not update work item status using PATCH method

我与影子孤独终老i 提交于 2021-01-05 14:37:50
问题 I am using DevOps restapi to get some information. The POST method is working fine for me. I want to update the status of my work item. For that I need to use the PATCH method. Which is not working, and not giving any kind of error. https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.1 function postApiData(ApiUrl, responseBody) { var res = ''; try { $.ajax({ type: 'POST', async: false, url: ApiUrl, contentType: 'application/json', data: JSON

Azure DevOps Set Build number variable in a Build Task

荒凉一梦 提交于 2020-12-16 04:55:39
问题 In Azure DevOps, I created a Build. In that Build I created a ProjectBuildNumber Pipeline variable that is Settable at queue time. That variable is then used under Options -> Build number format to set my build number displayed in Azure. However, I am trying to make that ProjectBuildNumber variable settable in the code I am building/deploying. Is there a way I can have a Task in my Build to update that ProjectBuildNumber and update the Build number in Azure DevOps? 回答1: Is there a way I can

Azure DevOps Set Build number variable in a Build Task

て烟熏妆下的殇ゞ 提交于 2020-12-16 04:51:00
问题 In Azure DevOps, I created a Build. In that Build I created a ProjectBuildNumber Pipeline variable that is Settable at queue time. That variable is then used under Options -> Build number format to set my build number displayed in Azure. However, I am trying to make that ProjectBuildNumber variable settable in the code I am building/deploying. Is there a way I can have a Task in my Build to update that ProjectBuildNumber and update the Build number in Azure DevOps? 回答1: Is there a way I can

Find Attachments in Azure DevOps REST Create

主宰稳场 提交于 2020-12-15 05:58:19
问题 When I submit an Attachment to the Azure DevOps REST service (create), is there a place I can go to visualise all of the attachments in there? Or is my best course of action to just send a GET which will give me the list? My problem then becomes...that there is no way for me to delete unwanted attachments. 回答1: Is there a place I can go to visualise all of the attachments in there? Or is my best course of action to just send a GET which will give me the list? I'm afraid, yes, the best course

Not able to download attachemet in devops rest api with proper filename and extension

浪子不回头ぞ 提交于 2020-12-15 04:29:00
问题 I was trying to download work item attachment from devops using the REST API. The file is downloading, but file name and extension are not correct and I'm unable to open after downloading the file. var personalaccesstoken = ""; var DeserializedClass = new List<Responcejson>(); string bseurl = "https://xxx/_apis/wit/attachments/xxxx-0cdb-4f53-9785-55d642d603e7?fileName=abc.png&download=true&api-version=5.0"; try { using (HttpClient client = new HttpClient()) { client.DefaultRequestHeaders