[Solved] pass value to custom field in azure board task, user story etc


There is no custom endpoint for populating fields, they are part of the workitem endpoint on _apis/wit/workitems and can be passad along in the POST request when creating a workitem or updated through PATCH request

Update the value of a field on an existing item

If you want to update a field on an existing workitem, make a PATCH request to the following url

https://dev.azure.com/{{ORGANIZATION}}/_apis/wit/workitems/{{ID}}?api-version=6.0

With the following body (replace {{FIELDVALUE}} with the actual value you want to set). Fields not mentioned in the body will remain as is

[
  {
    "op": "add",
    "path": "/fields/Custom.SysID",
    "value": "{{FIELDVALUE}}"
  }
]

Set the field upon creation of the workitem

If you are creating a workitem from scratch you make a POST request to

POST https://dev.azure.com/{{ORGANIZATION}}/_apis/wit/workitems/Task?api-version=6.0

The body is on the same format, but may contain other fields that should be initialized (like title):

[
  {
    "op": "add",
    "path": "/fields/Custom.SysID",
    "value": "{{FIELDVALUE}}"
  },
  {
    "op": "add",
    "path": "/fields/System.Title",
    "value": "MyTitle"
  }
]

0

solved pass value to custom field in azure board task, user story etc