Share via


States - List

Returns a list of all state definitions in a work item type of the process.

GET https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/states?api-version=7.2-preview.1

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

processId
path True

string (uuid)

The ID of the process

witRefName
path True

string

The reference name of the work item type

api-version
query True

string

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

Responses

Name Type Description
200 OK

WorkItemStateResultModel[]

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.work Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks.

Examples

Get state definitions

Sample request

GET https://dev.azure.com/{organization}/_apis/work/processes/{processId}/workItemTypes/{witRefName}/states?api-version=7.2-preview.1

Sample response

{
  "count": 4,
  "value": [
    {
      "id": "7b7e3e8c-e500-40b6-ad56-d59b8d64d757",
      "name": "New",
      "color": "b2b2b2",
      "stateCategory": "Proposed",
      "order": 1,
      "url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states/7b7e3e8c-e500-40b6-ad56-d59b8d64d757"
    },
    {
      "id": "277237cd-0bc0-4ffb-bdc6-d358b154ba9e",
      "name": "Active",
      "color": "007acc",
      "stateCategory": "InProgress",
      "order": 2,
      "url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states/277237cd-0bc0-4ffb-bdc6-d358b154ba9e"
    },
    {
      "id": "f36cfea7-889a-448e-b5d1-fbc9b134ec82",
      "name": "Resolved",
      "color": "ff9d00",
      "stateCategory": "Resolved",
      "order": 3,
      "url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states/f36cfea7-889a-448e-b5d1-fbc9b134ec82"
    },
    {
      "id": "9f479b88-4542-4f9d-8048-5d9c953b5082",
      "name": "Closed",
      "color": "339933",
      "stateCategory": "Completed",
      "order": 4,
      "url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/Microsoft.VSTS.WorkItemTypes.Bug/states/9f479b88-4542-4f9d-8048-5d9c953b5082"
    }
  ]
}

Definitions

Name Description
CustomizationType

Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process.

WorkItemStateResultModel

Class that represents a work item state result.

CustomizationType

Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process.

Value Description
custom

Customization-type is Custom if the newly created workitemtype is customized.

inherited

Customization-type is Inherited if the existing workitemtype of inherited process is customized.

system

Customization-type is System if is system generated workitemtype.

WorkItemStateResultModel

Class that represents a work item state result.

Name Type Description
color

string

Work item state color.

customizationType

CustomizationType

Work item state customization type.

hidden

boolean

If the Work item state is hidden.

id

string (uuid)

Id of the Workitemstate.

name

string

Work item state name.

order

integer (int32)

Work item state order.

stateCategory

string

Work item state statecategory.

url

string

Work item state url.