Processes

Last Update: 12/13/2016

api-version = 1.0

Processes contain configuration settings for team projects.

If you haven't already, look at the information on getting started with these APIs.

Get a list of processes

Get all processes in the project collection.

GET https://{instance}/DefaultCollection/_apis/process/processes?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes?api-version=1.0

Sample response

Status code: 200
{
  "count": 3,
  "value": [
    {
      "id": "adcc42ab-9882-485e-a3ed-7678f01f66bc",
      "description": "This template is flexible and will work great for most teams using Agile planning methods, including those practicing Scrum.",
      "isDefault": false,
      "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/adcc42ab-9882-485e-a3ed-7678f01f66bc",
      "name": "Agile"
    },
    {
      "id": "27450541-8e31-4150-9947-dc59f998fc01",
      "description": "This template is for more formal projects requiring a framework for process improvement and an auditable record of decisions.",
      "isDefault": false,
      "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/27450541-8e31-4150-9947-dc59f998fc01",
      "name": "CMMI"
    },
    {
      "id": "6b724908-ef14-45cf-84f8-768b5384da45",
      "description": "This template is for teams who follow the Scrum methodology and use Scrum terminology.",
      "isDefault": true,
      "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/6b724908-ef14-45cf-84f8-768b5384da45",
      "name": "Scrum"
    }
  ]
}

Sample code

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;

...

public void GetProcesses()
{   
   string _personalAccessToken = "your personal access token";
   string _credentials = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "", _personalAccessToken)));

   //use the httpclient        
   using (var client = new HttpClient())
   {
       //set our headers
       client.BaseAddress = new Uri("https://accountname.visualstudio.com/");
       client.DefaultRequestHeaders.Accept.Clear();
       client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
       client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _credentials);

       //send the request and content
       HttpResponseMessage response = client.GetAsync("_apis/process/processes?api-version=2.2").Result;

       if (response.IsSuccessStatusCode)
       {
           var result = response.Content.ReadAsStringAsync().Result;       
       }             
   }
}
using Microsoft.TeamFoundation.Core.WebApi;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.WebApi;

...

public GetProcesses()
{
   //create uri and VssBasicCredential variables
   Uri _uri = new Uri("https://accountname.visualstudio.com");
   string _personalAccessToken = "your personal access token";    
   VssBasicCredential _credentials = new VssBasicCredential("", _personalAccessToken);

   using (ProcessHttpClient processHttpClient = new ProcessHttpClient(_uri, _credentials))
   {
       List<Process> processes = processHttpClient.GetProcessesAsync().Result;>        
   }
}

Get a process

GET https://{instance}/DefaultCollection/_apis/process/processes/{processId}?api-version={version}
Parameter Type Notes
URL
instance string VS Team Services account ({account}.visualstudio.com) or TFS server ({server:port}).
processId string ID of the process.
api-version string Version of the API to use.

Sample request

GET https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/adcc42ab-9882-485e-a3ed-7678f01f66bc?api-version=1.0

Sample response

Status code: 200
{
  "id": "adcc42ab-9882-485e-a3ed-7678f01f66bc",
  "description": "This template is flexible and will work great for most teams using Agile planning methods, including those practicing Scrum.",
  "isDefault": false,
  "_links": {
    "self": {
      "href": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/adcc42ab-9882-485e-a3ed-7678f01f66bc"
    }
  },
  "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/process/processes/adcc42ab-9882-485e-a3ed-7678f01f66bc",
  "name": "Agile"
}

Sample code

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using Newtonsoft.Json;

...

public void GetProcess()
{   
   string _personalAccessToken = "your personal access token";
   string _credentials = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", "", _personalAccessToken)));

   string _processId = "ADCC42AB-9882-485E-A3ED-7678F01F66BC"; //id for system agile process

   //use the httpclient        
   using (var client = new HttpClient())
   {
       //set our headers
       client.BaseAddress = new Uri("https://accountname.visualstudio.com/");
       client.DefaultRequestHeaders.Accept.Clear();
       client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));
       client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", _credentials);

       //send the request and content
       HttpResponseMessage response = client.GetAsync("_apis/process/processes/" + _processId + "?api-version=2.2").Result;

       if (response.IsSuccessStatusCode)
       {
           var result = response.Content.ReadAsStringAsync().Result;       
       }             
   }
}
using Microsoft.TeamFoundation.Core.WebApi;
using Microsoft.VisualStudio.Services.Common;
using Microsoft.VisualStudio.Services.WebApi;

...

public GetProcess()
{
   //create uri and VssBasicCredential variables
   Uri _uri = new Uri("https://accountname.visualstudio.com");
   string _personalAccessToken = "your personal access token";    
   VssBasicCredential _credentials = new VssBasicCredential("", _personalAccessToken);

   string _processId = "ADCC42AB-9882-485E-A3ED-7678F01F66BC"; //id for system agile process

   using (ProcessHttpClient processHttpClient = new ProcessHttpClient(_uri, _credentials))
   {
      Process process = processHttpClient.GetProcessByIdAsync(_processId).Result;       
   }
}