Taskgroups - List

List task groups.

GET https://{instance}/{collection}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?api-version=5.0-preview.1
GET https://{instance}/{collection}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?expanded={expanded}&taskIdFilter={taskIdFilter}&deleted={deleted}&$top={$top}&continuationToken={continuationToken}&queryOrder={queryOrder}&api-version=5.0-preview.1

URI Parameters

Name In Required Type Description
collection
path True

string

The name of the Azure DevOps collection.

instance
path True

string

Azure DevOps server name ({server:port})

project
path True

string

Project ID or project name

taskGroupId
path

string

uuid

Id of the task group.

api-version
query True

string

Version of the API to use. This should be set to '5.0-preview.1' to use this version of the api.

$top
query

integer

int32

Number of task groups to get.

continuationToken
query

string

date-time

Gets the task groups after the continuation token provided.

deleted
query

boolean

'true'to include deleted task groups. Default is 'false'.

expanded
query

boolean

'true' to recursively expand task groups. Default is 'false'.

queryOrder
query

TaskGroupQueryOrder

Gets the results in the defined order. Default is 'CreatedOnDescending'.

taskIdFilter
query

string

uuid

Guid of the taskId to filter.

Responses

Name Type Description
200 OK

TaskGroup[]

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.taskgroups_read Grants the ability to read task groups

Examples

List all task groups
List all versions of a task group

List all task groups

Sample Request

GET https://{instance}/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=5.0-preview.1

Sample Response

{
  "count": 3,
  "value": [
    {
      "tasks": [
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "inlineScript": "Write-Host \"Hello World\""
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        },
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "inlineScript": "Write-Host \"New task\""
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        }
      ],
      "runsOn": [
        "Agent",
        "DeploymentGroup"
      ],
      "revision": 2,
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "createdOn": "2017-12-18T08:01:25.24Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "modifiedOn": "2017-12-18T08:01:25.893Z",
      "comment": "Updated the task group",
      "id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
      "name": "PowerShell TG1",
      "version": {
        "major": 1,
        "minor": 0,
        "patch": 0,
        "isTest": false
      },
      "category": "Deploy",
      "definitionType": "metaTask",
      "instanceNameFormat": "Task group: TG"
    },
    {
      "tasks": [
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": true,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"Hello World\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        },
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"New task\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        }
      ],
      "runsOn": [
        "Agent",
        "DeploymentGroup"
      ],
      "revision": 4,
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "createdOn": "2017-12-18T08:01:36.74Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "modifiedOn": "2017-12-18T08:01:43.787Z",
      "comment": "Published preview",
      "id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
      "name": "PowerShell TG1",
      "version": {
        "major": 2,
        "minor": 0,
        "patch": 0,
        "isTest": false
      },
      "iconUrl": "https://cdn.vsassets.io/v/20171217T033454/_content/icon-meta-task.png",
      "friendlyName": "PowerShell TG1",
      "category": "Deploy",
      "definitionType": "metaTask",
      "instanceNameFormat": "Task group: PowerShell TG1 "
    },
    {
      "tasks": [
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"Hello World\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        },
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"New task\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        }
      ],
      "runsOn": [
        "Agent",
        "DeploymentGroup"
      ],
      "revision": 1,
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "createdOn": "2017-12-17T20:15:04.517Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "modifiedOn": "2017-12-17T20:15:04.517Z",
      "id": "a4bec09c-4360-45cb-8242-78672fc31a53",
      "name": "My PowerShell TG2",
      "version": {
        "major": 1,
        "minor": 0,
        "patch": 0,
        "isTest": false
      },
      "friendlyName": "My PowerShell TG2",
      "category": "Deploy",
      "definitionType": "metaTask",
      "instanceNameFormat": "Task group: My PowerShell TG2 "
    }
  ]
}

List all versions of a task group

Sample Request

GET https://{instance}/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=5.0-preview.1

Sample Response

{
  "count": 2,
  "value": [
    {
      "tasks": [
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "inlineScript": "Write-Host \"Hello World\""
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        },
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "inlineScript": "Write-Host \"New task\""
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        }
      ],
      "runsOn": [
        "Agent",
        "DeploymentGroup"
      ],
      "revision": 2,
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "createdOn": "2017-12-18T08:01:25.24Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "modifiedOn": "2017-12-18T08:01:25.893Z",
      "comment": "Updated the task group",
      "id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
      "name": "PowerShell TG1",
      "version": {
        "major": 1,
        "minor": 0,
        "patch": 0,
        "isTest": false
      },
      "category": "Deploy",
      "definitionType": "metaTask",
      "instanceNameFormat": "Task group: TG"
    },
    {
      "tasks": [
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": true,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"Hello World\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        },
        {
          "displayName": "PowerShell Script",
          "alwaysRun": false,
          "continueOnError": false,
          "enabled": true,
          "timeoutInMinutes": 0,
          "inputs": {
            "scriptType": "inlineScript",
            "scriptName": "",
            "arguments": "",
            "inlineScript": "Write-Host \"New task\"",
            "workingFolder": "",
            "failOnStandardError": "true"
          },
          "task": {
            "id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
            "versionSpec": "1.*",
            "definitionType": "task"
          }
        }
      ],
      "runsOn": [
        "Agent",
        "DeploymentGroup"
      ],
      "revision": 4,
      "createdBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "createdOn": "2017-12-18T08:01:36.74Z",
      "modifiedBy": {
        "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
        "displayName": "Chuck Reinhart",
        "uniqueName": "fabfiber@outlook.com"
      },
      "modifiedOn": "2017-12-18T08:01:43.787Z",
      "comment": "Published preview",
      "id": "2da4ab36-6fd7-416f-a8ee-5b2a9d3bd61c",
      "name": "PowerShell TG1",
      "version": {
        "major": 2,
        "minor": 0,
        "patch": 0,
        "isTest": false
      },
      "iconUrl": "https://cdn.vsassets.io/v/20171217T033454/_content/icon-meta-task.png",
      "friendlyName": "PowerShell TG1",
      "category": "Deploy",
      "definitionType": "metaTask",
      "instanceNameFormat": "Task group: PowerShell TG1 "
    }
  ]
}

Definitions

Name Description
AuthorizationHeader
DataSourceBinding
Demand
IdentityRef
JObject
JToken
ReferenceLinks

The class to represent a collection of REST reference links.

TaskDefinitionReference
TaskExecution
TaskGroup
TaskGroupDefinition
TaskGroupQueryOrder

Gets the results in the defined order. Default is 'CreatedOnDescending'.

TaskGroupStep

Represents tasks in the task group.

TaskInputDefinition
TaskInputValidation
TaskOutputVariable
TaskReference
TaskSourceDefinition
TaskVersion

AuthorizationHeader

Name Type Description
name

string

Gets or sets the name of authorization header.

value

string

Gets or sets the value of authorization header.

DataSourceBinding

Name Type Description
callbackContextTemplate

string

Pagination format supported by this data source(ContinuationToken/SkipTop).

callbackRequiredTemplate

string

Subsequent calls needed?

dataSourceName

string

Gets or sets the name of the data source.

endpointId

string

Gets or sets the endpoint Id.

endpointUrl

string

Gets or sets the url of the service endpoint.

headers

AuthorizationHeader[]

Gets or sets the authorization headers.

initialContextTemplate

string

Defines the initial value of the query params

parameters

object

Gets or sets the parameters for the data source.

resultSelector

string

Gets or sets the result selector.

resultTemplate

string

Gets or sets the result template.

target

string

Gets or sets the target of the data source.

Demand

Name Type Description
name

string

value

string

IdentityRef

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and collections.

directoryAlias

string

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

This url is the full route to the source resource of this graph subject.

JObject

Name Type Description
item

JToken

type

string

JToken

Name Type Description
first

JToken

hasValues

boolean

item

JToken

last

JToken

next

JToken

parent

string

path

string

previous

JToken

root

JToken

type

string

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

TaskDefinitionReference

Name Type Description
definitionType

string

Gets or sets the definition type. Values can be 'task' or 'metaTask'.

id

string

Gets or sets the unique identifier of task.

versionSpec

string

Gets or sets the version specification of task.

TaskExecution

Name Type Description
execTask

TaskReference

The utility task to run. Specifying this means that this task definition is simply a meta task to call another task. This is useful for tasks that call utility tasks like powershell and commandline

platformInstructions

object

If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } net20: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } java: { jar: "powershelltask.tasks.automation.teamfoundation.microsoft.com", } node: { script: "powershellhost.js", }

TaskGroup

Name Type Description
agentExecution

TaskExecution

author

string

category

string

comment

string

Gets or sets comment.

contentsUploaded

boolean

contributionIdentifier

string

contributionVersion

string

createdBy

IdentityRef

Gets or sets the identity who created.

createdOn

string

Gets or sets date on which it got created.

dataSourceBindings

DataSourceBinding[]

definitionType

string

deleted

boolean

Gets or sets as 'true' to indicate as deleted, 'false' otherwise.

demands

Demand[]

deprecated

boolean

description

string

disabled

boolean

execution

<string,  JObject>

friendlyName

string

groups

TaskGroupDefinition[]

helpMarkDown

string

hostType

string

iconUrl

string

id

string

inputs

TaskInputDefinition[]

instanceNameFormat

string

minimumAgentVersion

string

modifiedBy

IdentityRef

Gets or sets the identity who modified.

modifiedOn

string

Gets or sets date on which it got modified.

name

string

outputVariables

TaskOutputVariable[]

owner

string

Gets or sets the owner.

packageLocation

string

packageType

string

parentDefinitionId

string

Gets or sets parent task group Id. This is used while creating a draft task group.

postJobExecution

<string,  JObject>

preJobExecution

<string,  JObject>

preview

boolean

releaseNotes

string

revision

integer

Gets or sets revision.

runsOn

string[]

satisfies

string[]

serverOwned

boolean

showEnvironmentVariables

boolean

sourceDefinitions

TaskSourceDefinition[]

sourceLocation

string

tasks

TaskGroupStep[]

Gets or sets the tasks.

version

TaskVersion

visibility

string[]

TaskGroupDefinition

Name Type Description
displayName

string

isExpanded

boolean

name

string

tags

string[]

visibleRule

string

TaskGroupQueryOrder

Gets the results in the defined order. Default is 'CreatedOnDescending'.

Name Type Description
createdOnAscending

string

Order by createdon ascending.

createdOnDescending

string

Order by createdon descending.

TaskGroupStep

Represents tasks in the task group.

Name Type Description
alwaysRun

boolean

Gets or sets as 'true' to run the task always, 'false' otherwise.

condition

string

Gets or sets condition for the task.

continueOnError

boolean

Gets or sets as 'true' to continue on error, 'false' otherwise.

displayName

string

Gets or sets the display name.

enabled

boolean

Gets or sets as task is enabled or not.

environment

object

Gets dictionary of environment variables.

inputs

object

Gets or sets dictionary of inputs.

task

TaskDefinitionReference

Gets or sets the reference of the task.

timeoutInMinutes

integer

Gets or sets the maximum time, in minutes, that a task is allowed to execute on agent before being cancelled by server. A zero value indicates an infinite timeout.

TaskInputDefinition

Name Type Description
aliases

string[]

defaultValue

string

groupName

string

helpMarkDown

string

label

string

name

string

options

object

properties

object

required

boolean

type

string

validation

TaskInputValidation

visibleRule

string

TaskInputValidation

Name Type Description
expression

string

Conditional expression

message

string

Message explaining how user can correct if validation fails

TaskOutputVariable

Name Type Description
description

string

name

string

TaskReference

Name Type Description
id

string

inputs

object

name

string

version

string

TaskSourceDefinition

Name Type Description
authKey

string

endpoint

string

keySelector

string

selector

string

target

string

TaskVersion

Name Type Description
isTest

boolean

major

integer

minor

integer

patch

integer