States - Create
Creates a state definition in the work item type of the process.
POST 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. |
process
|
path | True |
string uuid |
The ID of the process |
wit
|
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. |
Request Body
Name | Type | Description |
---|---|---|
color |
string |
Color of the state |
name |
string |
Name of the state |
order |
integer |
Order in which state should appear |
stateCategory |
string |
Category of the state |
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.work_write | Grants the ability to read, create, and update work items and queries, update board metadata, read area and iterations paths other work item tracking related metadata, execute queries, and to receive notifications about work item events via service hooks. |
Examples
Create state definition
Sample Request
POST https://dev.azure.com/fabrikam/_apis/work/processes/{processId}/workItemTypes/{witRefName}/states?api-version=7.2-preview.1
{
"name": "Ready to test",
"color": "b2b2b2",
"stateCategory": "Proposed"
}
Sample Response
{
"id": "9a04860f-4e88-4ef1-9137-d24b0244e3c2",
"name": "Ready to test",
"color": "b2b2b2",
"stateCategory": "Proposed",
"order": 2,
"url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/Agile1.Bug/states/9a04860f-4e88-4ef1-9137-d24b0244e3c2",
"customizationType": "custom"
}
Definitions
Name | Description |
---|---|
Customization |
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. |
Work |
Class That represents a work item state input. |
Work |
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.
Name | Type | Description |
---|---|---|
custom |
string |
Customization-type is Custom if the newly created workitemtype is customized. |
inherited |
string |
Customization-type is Inherited if the existing workitemtype of inherited process is customized. |
system |
string |
Customization-type is System if is system generated workitemtype. |
WorkItemStateInputModel
Class That represents a work item state input.
Name | Type | Description |
---|---|---|
color |
string |
Color of the state |
name |
string |
Name of the state |
order |
integer |
Order in which state should appear |
stateCategory |
string |
Category of the state |
WorkItemStateResultModel
Class that represents a work item state result.
Name | Type | Description |
---|---|---|
color |
string |
Work item state color. |
customizationType |
Work item state customization type. |
|
hidden |
boolean |
If the Work item state is hidden. |
id |
string |
Id of the Workitemstate. |
name |
string |
Work item state name. |
order |
integer |
Work item state order. |
stateCategory |
string |
Work item state statecategory. |
url |
string |
Work item state url. |
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for