Questions tagged [azure-devops-rest-api]

Azure DevOps Services REST API (previously: Visual Studio Team Services REST APIs) is a set of APIs allowing management of Azure DevOps (formerly: Visual Studio Team Services) accounts as well as TFS 2015/2017/2018/2019 servers.

What's your goal? APIs to use:

  • Accounts and Profiles
    • Access user accounts or profiles
  • Build (2.0)
    • Automatically kick off a build
    • Get details from a completed build
    • Add a tag to a build
  • Widgets
    • Add a widget to a dashboard
  • Git
    • Get Git repositories
    • Add status to a commit
    • Get details/status for a pull request
    • Create a file (push)
  • Project and Teams
    • Create a project
    • Get a list of projects
  • Work Item Tracking
    • Get a list of work items
    • Create a work item
    • Update a work item
    • Add a link to a work item

More Information

1869 questions
5
votes
1 answer

VssConnection to VSTS always prompts for credentials

I am using the Visual Studio client tools for calling the VSTS REST APIs in a command line utility. This utility can be run several times for different commands (Copy, Delete, applying policies, etc.) I'm creating the VssConnection like such public…
Jim
  • 4,910
  • 4
  • 32
  • 50
5
votes
1 answer

Authenticating to VisualStudioOnline REST API with Personal Access Token using Python 3.6

I am trying to use the VisualStudioOnline REST API using python 3.6. (Plenty of examples using python 2.x.) The python script response is the generic html login page. I have tested the url generated by this script using REST Console Chrome plug-in…
5
votes
5 answers

Update vsts-npm-auth with new username and password

I have installed the vsts-npm-auth package using following command: npm install -g vsts-npm-auth --registry https://registry.npmjs.com And I ran vsts-npm-auth -config .npmrc command to set the credential but I am facing below error: Now I need to…
AnandSonake
  • 567
  • 1
  • 8
  • 19
5
votes
0 answers

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

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…
5
votes
1 answer

WIQL tree query to get all parent work items from single child Id?

I have this WIQL... Wiql wiql = new Wiql() { Query = string.Format("SELECT [System.Id], [System.WorkItemType], [System.Title], [System.AssignedTo], [System.State]" + " FROM WorkItemLinks" + "…
Jacob
  • 323
  • 1
  • 7
  • 16
5
votes
3 answers

How to get build definitions from TFS using REST API in a VSTS dashboard widget?

I'm trying to get all existing build definitions on a TFS 2015 Update 3 server using the REST API from Microsofts VSTS SDK in a dashboard widget: VSS.init({ explicitNotifyLoaded: true, usePlatformStyles:…
4
votes
1 answer

Azure DevOps API - Create new branch from master without adding changes

I'm attempting to use Azure DevOps Services Rest API to create a new branch from master but I've been unsuccessful. Docs: https://learn.microsoft.com/en-us/rest/api/azure/devops/git/refs/update-refs?view=azure-devops-rest-5.1#examples Endpoint:…
4
votes
1 answer

Obtain all work items from Azure DevOps that have been merged into a branch via JavaScript

The idea I am currently developing a 'release notes' application using NodeJS that calls various Azure DevOps REST API endpoints to obtain work items based on a specific tag. What I have right now What I have at the moment works like this; Some…
4
votes
3 answers

TF401398: The pull request cannot be activated because the source and/or the target branch no longer exists, or the requested refs are not branches

I was getting the following errors while creating a pull-request using azuredevops golang API error: TF401398: The pull request cannot be activated because the source and/or the target branch no longer exists, or the requested refs are not…
Niyas Ali
  • 203
  • 2
  • 9
4
votes
2 answers

Is the Azure DevOps Rest Api returning the correct number of pullrequests?

We are trying to gather information about our pull requests to establish certain metrices (how long does it take until a pull request is completed, ...) for our department. Azure DevOps provides an API to query a lot of stuff, including pull…
10rotator01
  • 635
  • 6
  • 15
4
votes
1 answer

Is there is a way to get Pull Request ID in Azure DevOps after clicking on complete button in Pull Request

I'm executing a pipeline flow after creating a PR and I need to get Pull Request ID after I click the complete button. I'm using $(System.PullRequest.PullRequestId) to fetch the value, but it is always an empty value and gives the error output…
4
votes
1 answer

How to find oldobjectid when Uploading/pushing a file to Azure Devops Repo using Pushes Create Api with Python

I was trying to automate the task of pushing some files to various folder in a repo. I tried using Rest API provided by azure. When using Pushes Create API for the same, from the docs this is the content in the request body Snapshot of request…
4
votes
1 answer

How can we copy a bulk of workitems from one project to another in Azure Devops?

I need to copy a list of work items from one project to another project within an organisation in Azure Devops, is that possible? how to do that?
4
votes
0 answers

Azure Devops Rest API - Create Pull Request Owner Issue When Using PAT

I am trying to create pull request with createdby option like below JSON via rest api; { "createdBy": {"id": "b568ab19-05a8-6199-9bee-95f3b7b994c9"}, "sourceRefName": "refs/heads/hotfixes/hotfix-test-2", "targetRefName": "refs/heads/master", …
nrllhcinar
  • 109
  • 5
4
votes
1 answer

How to identify the latest stable REST API version of Azure DevOps Services?

In my project, there is a requirement to create Azure artifacts feed automatically. For this I used REST API mentioned in this doc:…