Azure devops boards REST API - move ticket between columns Azure devops boards REST API - move ticket between columns azure azure

Azure devops boards REST API - move ticket between columns


Solution 1

To move workitem to another column you have to change "WEF_{id}_Kanban.Column" field.

Use PATCH to update your workitem with body:

[    {        "op": "replace",        "path": "/fields/WEF_F9DCD9224F6E466499435017DB7D2D07_Kanban.Column",        "value": "<column name>"    }]

Solution 2

To move workitem to another column you have to change it "state". This only works if you assigned that state to the column.

Use PATCH to update your workitem with body:

[    {        "op": "replace",        "path": "/fields/System.State",        "value": "<column name>"    }]

doc: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-6.0

EDIT (Adding new state):

Go to organization settings -> Process -> choose your workflow -> choose item type -> states -> new state (Add "In progress" here)

enter image description here

Tutorial: https://docs.microsoft.com/en-us/azure/devops/organizations/settings/work/customize-process-workflow?view=azure-devops#add-a-workflow-state

Then go to column setting on Kanban Board and associate new state with column

enter image description here

Tutorial: https://docs.microsoft.com/en-us/azure/devops/boards/boards/add-columns?view=azure-devops#update-kanban-column-to-state-mappings

After that try using API REST to change state, it should work


To alter the System.State of a task I had to alter the System.Reason as well. For some reason the two fields are connected and both changes are necessary to trigger a transition from one column to the other.

For example to change a task from the state To Do to In Progress use the Work Items - Update REST API with the following request body:

[  {    "op": "replace",    "path": "/fields/System.State",    "value": "In Progress"  },  {    "op": "replace",    "path": "/fields/System.Reason",    "value": "Work started"  }]