代码之家  ›  专栏  ›  技术社区  ›  NAB

通过Rest API添加后,WorkItem上未显示字段

  •  0
  • NAB  · 技术社区  · 6 年前

    我已经使用Rest API成功地将字段添加到流程中。

    当我呼叫以下

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

    使用以下Json

    { “defaultValue”:空, “referenceName”:“my.test”, “name”:“test”, “type”:“string”, “只读”:false, “必需”:false, “pickList”:空, “url”:空, “allowGroups”:空 }

    它返回以下成功消息

    { “referenceName”:“my.test”, “name”:“test”, “type”:“string”, “pickList”:空, “只读”:false, “必需”:false, “defaultValue”:空, “url”: https://my.visualstudio.com/_apis/work/processDefinitions/a949f163-8d2c-4183-b26b-8f5b5385ef15/workItemTypes/my.ProductBacklogItem/fields/my.test “, “allowGroups”:空 }

    但是,在VSTS中,该字段不会显示在工作项上

    1 回复  |  直到 6 年前
        1
  •  0
  •   starian chen-MSFT    6 年前

    您刚刚将新字段添加到PBI工作项,但没有将该字段的控制引用添加到PBI工作项。

    请参阅此请求以向PBI工作项添加新控件:

    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
    

    正文:应用程序/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}