0
votes

I have successfully added field to the process using Rest API's.

when I call the following

Post https://my.visualstudio.com/_apis/work/processdefinitions/a949f163-8d2c-4183-b26b-8f5b5385ef15/workItemTypes/my.ProductBacklogItem/fields?api-version=4.1-preview

​with following Json

{ "defaultValue": null, "referenceName": "my.test", "name": "test", "type": "string", "readOnly": false, "required": false, "pickList": null, "url": null, "allowGroups": null }

it returns me the following success msg

{ "referenceName": "my.test", "name": "test", "type": "string", "pickList": null, "readOnly": false, "required": false, "defaultValue": null, "url": "https://my.visualstudio.com/_apis/work/processDefinitions/a949f163-8d2c-4183-b26b-8f5b5385ef15/workItemTypes/my.ProductBacklogItem/fields/my.test", "allowGroups": null }

however in the VSTS the field is not displayed on the workItem

1

1 Answers

0
votes

You just added the new field to PBI work item, but don’t add control reference that field to PBI work item.

Refer to this request to add new control to PBI work item:

Put https://{account}.visualstudio.com/_apis/work/processDefinitions/{process template id}/workItemTypes/my.ProductBacklogItem/layout/groups/my.Product Backlog Item.Product Backlog Item.Details/Controls/my.test?api-version=4.1-preview

Body: application/json

{"order":null,"label":"testcontrol","readOnly":false,"visible":true,"controlType":null,"metadata":null,"inherited":null,"overridden":null,"watermark":null,"contribution":null,"height":null,"isContribution":false}