Taskgroups - List

List task groups.

GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?api-version=6.0-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/distributedtask/taskgroups/{taskGroupId}?expanded={expanded}&taskIdFilter={taskIdFilter}&deleted={deleted}&$top={$top}&continuationToken={continuationToken}&queryOrder={queryOrder}&api-version=6.0-preview.1

URI Parameters

Name In Required Type Description
organization
path True
  • string

The name of the Azure DevOps organization.

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 '6.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

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

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://dev.azure.com/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=6.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://dev.azure.com/fabrikam/{project}/_apis/distributedtask/taskgroups?api-version=6.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

AuthorizationHeader
DataSourceBinding
Demand
IdentityRef
JObject

Represents a JSON object.

JToken

Represents an abstract JSON token.

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

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.

requestContent
  • string

Gets or sets http request body

requestVerb
  • string

Gets or sets http request verb

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

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 Organizations.

directoryAlias
  • string

Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary

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

Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary

inactive
  • boolean

Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary

isAadIdentity
  • boolean

Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType)

isContainer
  • boolean

Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType)

isDeletedInOrigin
  • boolean
profileUrl
  • string

Deprecated - not in use in most preexisting implementations of ToIdentityRef

uniqueName
  • string

Deprecated - use Domain+PrincipalName instead

url
  • string

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

JObject

Represents a JSON object.

Name Type Description
item

Represents an abstract JSON token.

type
  • string

Gets the node type for this JToken.

JToken

Represents an abstract JSON token.

Name Type Description
first

Get the first child token of this token.

hasValues
  • boolean

Gets a value indicating whether this token has child tokens.

item

Represents an abstract JSON token.

last

Get the last child token of this token.

next

Gets the next sibling token of this node.

parent
  • string

Gets or sets the parent.

path
  • string

Gets the path of the JSON token.

previous

Gets the previous sibling token of this node.

root

Gets the root JToken of this JToken.

type
  • string

Gets the node type for this JToken.

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

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
author
  • string
category
  • string
comment
  • string

Gets or sets comment.

contentsUploaded
  • boolean
contributionIdentifier
  • string
contributionVersion
  • string
createdBy

Gets or sets the identity who created.

createdOn
  • string

Gets or sets date on which it got created.

dataSourceBindings
definitionType
  • string
deleted
  • boolean

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

demands
deprecated
  • boolean
description
  • string
disabled
  • boolean
execution
friendlyName
  • string
groups
helpMarkDown
  • string
helpUrl
  • string
hostType
  • string
iconUrl
  • string
id
  • string
inputs
instanceNameFormat
  • string
minimumAgentVersion
  • string
modifiedBy

Gets or sets the identity who modified.

modifiedOn
  • string

Gets or sets date on which it got modified.

name
  • string
outputVariables
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
preJobExecution
preview
  • boolean
releaseNotes
  • string
revision
  • integer

Gets or sets revision.

runsOn
  • string[]
satisfies
  • string[]
serverOwned
  • boolean
showEnvironmentVariables
  • boolean
sourceDefinitions
sourceLocation
  • string
tasks

Gets or sets the tasks.

version
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

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
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