Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure devops boards REST API - move ticket between columns

I'm testing out the Azure Boards rest API. I can currently create, delete and get items successfully, however I can't seem to move them between columns.

This is my request https://{{AzureBoardsToken}}@{{AzureBoardsPath}}/_apis/wit/workitems/8907?api-version=6.0-preview.3

with a payload of

[
  {
    "op": "move",
    "path": "{no idea what to put here}",
    "from": "{no idea what to put here}",
    "value": "{not sure if this is relevant for this operation}"
  }
]

I don't find the documentation particularly useful as it assumes you know what those properties mean and where to get them.

Any help would be highly appreciated! The idea is to then integrate it in nodejs

like image 531
DjayCi Avatar asked May 06 '26 11:05

DjayCi


1 Answers

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://learn.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://learn.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://learn.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

like image 79
Tomasz Kaniewski Avatar answered May 10 '26 10:05

Tomasz Kaniewski