Work Item Types Fields - Add
将字段添加到进程中的工作项类型。
POST https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/workItemTypes/{witRefNameForFields}/fields?api-version=4.1-preview.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
process
|
path | True |
string uuid |
进程的 ID |
wit
|
path | True |
string |
字段的工作项类型引用名称 |
api-version
|
query | True |
string |
要使用的 API 版本。 应将其设置为“4.1-preview.1”才能使用此版本的 API。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
allowGroups |
boolean |
|
defaultValue |
string |
|
name |
string |
|
pickList | ||
readOnly |
boolean |
|
referenceName |
string |
|
required |
boolean |
|
type | ||
url |
string |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功的操作 |
安全性
accessToken
个人访问令牌。 将任何值用作用户名和令牌作为密码。
类型:
basic
示例
Add field to work item type
示例请求
POST https://dev.azure.com/{organization}/_apis/work/processdefinitions/{processId}/workItemTypes/{witRefNameForFields}/fields?api-version=4.1-preview.1
{
"defaultValue": "",
"referenceName": "DifferentFields.Argument",
"name": null,
"type": null,
"readOnly": false,
"required": false,
"pickList": null,
"url": null,
"allowGroups": null
}
示例响应
{
"referenceName": "DifferentFields.Argument",
"name": "Argument",
"type": "html",
"pickList": null,
"readOnly": false,
"required": false,
"defaultValue": null,
"url": "https://dev.azure.com/fabrikam/_apis/work/processDefinitions/a6c1d9b6-ea27-407d-8c40-c9b7ab112bb6/workItemTypes/myAgile.CustomWIT/fields/DifferentFields.Argument",
"allowGroups": null
}
定义
名称 | 说明 |
---|---|
Field |
字段类型 |
Pick |
|
Work |
FieldType
字段类型
值 | 说明 |
---|---|
boolean | |
dateTime | |
double | |
guid | |
history | |
html | |
identity | |
integer | |
picklistDouble | |
picklistInteger | |
picklistString | |
plainText | |
string | |
treePath |
PickListMetadataModel
名称 | 类型 | 说明 |
---|---|---|
id |
string |
选择列表的 ID |
isSuggested |
boolean |
用户的输入值是否仅限于建议的值 |
name |
string |
选择列表的名称 |
type |
string |
选择列表的类型 |
url |
string |
选择列表的 URL |
WorkItemTypeFieldModel
名称 | 类型 | 说明 |
---|---|---|
allowGroups |
boolean |
|
defaultValue |
string |
|
name |
string |
|
pickList | ||
readOnly |
boolean |
|
referenceName |
string |
|
required |
boolean |
|
type | ||
url |
string |