azure-devops-rest-api

Create Build Definition using Azure Devops API

99封情书 提交于 2019-12-23 01:29:15
问题 We are trying to create build definition by copy another build definition information using Azure Devops Rest API however getting the below error: HttpError BadRequest - Value cannot be null. Parameter name: definition.Repository.Mappings.Mapping.ServerPath. Here are the steps we are following Get the build information using API - This step is working fine Modify the name of the build definition Create the new build definition by passing the above build definitions request Body Sample code

VSTS work items list through REST API

隐身守侯 提交于 2019-12-22 18:25:02
问题 How can I get a list of work items from VSTS using the REST API? According to the documentation, the ids parameter is optional, but when I omit it I get a 404 error. If I add the ids parameter, I can get the items. Failing request: GET https://{account}.visualstudio.com/DefaultCollection/_apis/wit/workitems?api-version=1.0 Succeeding request: GET https://{account}.visualstudio.com/DefaultCollection/_apis/wit/workitems?ids=252&api-version=1.0 Authentication is the same for both. The complete

TF400813: Resource not available for anonymous access. Client authentication required

血红的双手。 提交于 2019-12-22 14:49:08
问题 I am working on the CodedUI Test Automation project. i am developing a framework in which i am trying to access Test Cases in VSTS through RestAPI . I have worked on an MVC application previously in which i did the same thing to pull data from VSTS using RestAPI . Now the problem is i am not able to access the VSTS . Everytime i am trying to access the VSTS , i got the exception TF400813: Resource not available for anonymous access. Client authentication required . I am using the same PAT

How best to download source files from VSTS?

落花浮王杯 提交于 2019-12-22 08:24:42
问题 I need to regularly download a complete set of latest code for a particular project from a VSTS account (server workspace), to a folder on a file server for readonly archiving. Currently I log on to the web portal and click Download as ZIP for the selected project and save this to the file server. But I'd like a more automated way, preferably something I can schedule to run from the file server itself which won't have Visual Studio installed or cached credentials for the online account. Any

How to Add test results to a test run in VSTS using Rest API programatically

雨燕双飞 提交于 2019-12-20 06:34:01
问题 I've got API link for this task POST https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}/results?api-version={version} https://www.visualstudio.com/en-us/docs/integrate/api/test/results#add-test-results-to-a-test-run I need program to do through API way. Alternative, i've tried with program below public void GetResult() { var u = new Uri("https://{UserAccount}.visualstudio.com"); VssCredentials c = new VssCredentials(new Microsoft.VisualStudio.Services.Common

Getting a '403 Forbidden' when calling the Pull Request API on VSTS

旧街凉风 提交于 2019-12-20 06:16:16
问题 For other APIs that I'm calling (including Analytics), it all seems to work fine, but when I try to make any Pull Request queries, I get a 403 Forbidden . The calls are being made by my private Windows agent with PAT authorised with all scopes. It is using @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} . Is there some other permission I need to set somewhere? Edit 1: If I use $header = @{Authorization = "Basic <hard coded base64 encoded string used in the header for my Postman queries>"}

Add Test Result to a test run(testcase) in VSTS

瘦欲@ 提交于 2019-12-20 04:25:27
问题 I need to add test result to a testcase in VSTS. I'm new to VSTS and not sure what went wrong with my code var ur = new Uri("https://{myaccount}.visualstudio.com"); VssCredentials cr = new VssCredentials(new Microsoft.VisualStudio.Services.Common.VssBasicCredential(string.Empty, "XXXXX")); var connection = new VssConnection(ur, cr); var testClient = connection.GetClient<TestManagementHttpClient>(); int testpointid = 123; string teamProject = "myproj"; RunCreateModel run = new RunCreateModel

Why I get Internet Explorer enhanced security error message in Chrome if I call VSO API from Angularjs SPA?

纵然是瞬间 提交于 2019-12-19 05:57:34
问题 I have a SPA implemented in Angularjs - Typescript calling VSO API and providing authentication data you can find below: ((): void => { "use strict"; angular .module("app") .config(config); config.$inject = [ "$httpProvider" ]; function config( $httpProvider: ng.IHttpProvider ) { $httpProvider.defaults.headers.common['Authorization'] = "Bearer username:password"; } }); I see the Network tab of the browser that this call will be redirected to here: https://app.vssps.visualstudio.com/_signin

How to display “Area path” in VSTS build task input PickList?

半城伤御伤魂 提交于 2019-12-17 13:43:01
问题 I need to display the the "Area path" in a VSTS Build task input PickList, so that I can retrieve the user selected "Area path" value from my build task and set it in a work item generated by the build task. Is this possible with existing VSTS API? If so how to do this? I think this is done in Copy Files task in Utilty section. Thanks in advance. 回答1: Yes, it is. You can add following section in task.josn file to achieve this: "inputs": [ { "name": "rootArea", "type": "pickList", "label":

Start a build and passing variables through VSTS Rest API

这一生的挚爱 提交于 2019-12-17 12:11:09
问题 I would like to start a Visual Studio Team Service build through the REST API. There is an API for queuing builds but I couldn't find a way to define variables. 回答1: The accepted answer does not really answers the question when you need to set a value at queue time. The solution is actually pretty simple you just have to add a parameters field to the json payload. The content should be a json string (not directly an object) containing the parameters Ex : { "parameters": "{\"ReleaseNumber\": \