在Azure任务,用户案例等中将值传递给自定义字段 [英] pass value to custom field in azure board task, user story etc

查看:51
本文介绍了在Azure任务,用户案例等中将值传递给自定义字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ado板上创建了一个自定义字段,现在我想使用REST API将值传递给它,请告诉我是否可行?请查看下面的屏幕截图作为示例

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

如通过REST API截屏中突出显示的那样,如何将值传递到自定义字段中

How to pass value in to the custom field as highlighted in the screen shot via REST API

推荐答案

没有用于填充字段的自定义端点,它们是 _apis/wit/workitems 上workitem端点的一部分,可以通过创建工作项或通过 PATCH 请求

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

使用以下正文(将 {{FIELDVALUE}} 替换为要设置的实际值).正文中未提及的字段将保持不变

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}}"
  }
]

在创建工作项时设置字段

如果您是主体具有相同的格式,但可能包含其他应初始化的字段(例如标题):

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"
  }
]

这篇关于在Azure任务,用户案例等中将值传递给自定义字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆