I have created a custom field on the ado board ,now I would like to pass value in to it using REST API, pls let me know if that is possible ?if so how? please look at the below screen shot for an example
How to pass value in to the custom field as highlighted in the screen shot via REST API
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
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}}"
}
]
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"
}
]