Publishers - List Event Types

获取特定发布者的事件类型。

GET https://dev.azure.com/{organization}/_apis/hooks/publishers/{publisherId}/eventtypes?api-version=7.1

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

publisherId
path True

string

发布者的 ID。

api-version
query True

string

要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。

响应

名称 类型 说明
200 OK

EventTypeDescriptor[]

成功作

安全性

oauth2

类型: oauth2
流向: accessCode
授权 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

作用域

名称 说明
vso.work 授予读取工作项、查询、版块、区域和迭代路径以及其他工作项跟踪相关元数据的能力。 此外,还授予执行查询、搜索工作项以及通过服务挂钩接收有关工作项事件的通知的能力。
vso.build 授予访问生成项目(包括生成结果、定义和请求)的能力,以及通过服务挂钩接收有关生成事件的通知的能力。
vso.code 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还可以通过服务挂钩搜索代码并获取有关版本控制事件的通知。

示例

示例请求

GET https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventtypes?api-version=7.1

示例响应

{
  "count": 9,
  "value": [
    {
      "publisherId": "tfs",
      "id": "build.complete",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/build.complete",
      "name": "Build completed",
      "description": "A build completes",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "definitionName",
          "name": "Build Definition",
          "description": "Filter events to include only completed builds for the specified definition",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "buildStatus",
          "name": "Build Status",
          "description": "Filter events to include only completed builds for the specified completion status",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              },
              {
                "value": "Succeeded",
                "displayValue": "Succeeded"
              },
              {
                "value": "PartiallySucceeded",
                "displayValue": "Partially Succeeded"
              },
              {
                "value": "Failed",
                "displayValue": "Failed"
              },
              {
                "value": "Stopped",
                "displayValue": "Stopped"
              }
            ],
            "isLimitedToPossibleValues": true
          }
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "message.posted",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/message.posted",
      "name": "Team room message posted",
      "description": "Triggers when a message is posted to a team room",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "roomId",
          "name": "Team room",
          "description": "Filter events to include only messages sent to the specified Team room",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "number",
            "isRequired": true
          },
          "values": {
            "defaultValue": "",
            "possibleValues": []
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "messagePattern",
          "name": "Message contains string",
          "description": "The string that must be found in the message",
          "inputMode": "textBox",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string",
            "pattern": "^[^&<>'\"]*$",
            "patternMismatchErrorMessage": "Value cannot contain any of characters: &, <, >, ' (apostrophe), or \\\" (quote).",
            "maxLength": 1024
          },
          "values": {
            "defaultValue": "",
            "possibleValues": []
          }
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "git.pullrequest.created",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.pullrequest.created",
      "name": "Pull request created",
      "description": "Pull request is created in a git repository",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "repository",
          "name": "Repository",
          "description": "The repository that code was pushed to",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "guid"
          },
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "branch",
          "name": "Target branch",
          "description": "The target branch of the pull request",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "dependencyInputIds": [
            "repository"
          ],
          "hasDynamicValueInformation": true
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "git.pullrequest.updated",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.pullrequest.updated",
      "name": "Pull request updated",
      "description": "Pull request is updated – status, review list, reviewer vote changed or the source branch is updated with a push",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "repository",
          "name": "Repository",
          "description": "The repository that code was pushed to",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "guid"
          },
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "branch",
          "name": "Target branch",
          "description": "The target branch of the pull request",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "dependencyInputIds": [
            "repository"
          ],
          "hasDynamicValueInformation": true
        },
        {
          "id": "notificationType",
          "name": "Change",
          "description": "The type of pull request change",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              },
              {
                "value": "PushNotification",
                "displayValue": "Source branch updated"
              },
              {
                "value": "ReviewersUpdateNotification",
                "displayValue": "Reviewers changed"
              },
              {
                "value": "StatusUpdateNotification",
                "displayValue": "Status changed"
              },
              {
                "value": "ReviewerVoteNotification",
                "displayValue": "Votes score changed"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          }
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "git.push",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/git.push",
      "name": "Code pushed",
      "description": "Code is pushed to a git repository",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "repository",
          "name": "Repository",
          "description": "The repository that code was pushed to",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "guid"
          },
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "branch",
          "name": "Branch",
          "description": "The branch that code was pushed into",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "values": {
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true
          },
          "dependencyInputIds": [
            "repository"
          ],
          "hasDynamicValueInformation": true
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "tfvc.checkin",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/tfvc.checkin",
      "name": "Code checked in",
      "description": "A changeset is checked into version control.",
      "supportedResourceVersions": [
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "path",
          "name": "Under path",
          "description": "Filter to checkins that change one or more files under the specified path",
          "inputMode": "textBox",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string",
            "isRequired": true,
            "pattern": "^\\$\\/[^&<>'\"]*$"
          },
          "values": {
            "defaultValue": "$/"
          }
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "workitem.created",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.created",
      "name": "Work item created",
      "description": "Filter events to include only newly created work items.",
      "supportedResourceVersions": [
        "1.0-preview.2",
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "areaPath",
          "name": "Area path",
          "description": "Filter events to include only work items under the specified area path.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "workItemType",
          "name": "Work item type",
          "description": "Filter events to include only work items of the specified type.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "workitem.commented",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.commented",
      "name": "Work item commented on",
      "description": "Filter events to include only work items commented on.",
      "supportedResourceVersions": [
        "1.0-preview.2",
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "areaPath",
          "name": "Area path",
          "description": "Filter events to include only work items under the specified area path.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "workItemType",
          "name": "Work item type",
          "description": "Filter events to include only work items of the specified type.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "commentPattern",
          "name": "Contains string",
          "description": "The string that must be found in the comment.",
          "inputMode": "textBox",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string",
            "pattern": "^\\s*[^\\s&<>'\"][^&<>'\"]*$",
            "patternMismatchErrorMessage": "Value should contain at least one non whitespace character and cannot contain any of characters: &, <, >, ' (apostrophe), or \" (quote).",
            "minLength": 1,
            "maxLength": 1024
          },
          "values": {
            "defaultValue": "",
            "possibleValues": []
          }
        }
      ]
    },
    {
      "publisherId": "tfs",
      "id": "workitem.updated",
      "url": "https://dev.azure.com/fabrikam/_apis/hooks/publishers/tfs/eventTypes/workitem.updated",
      "name": "Work item updated",
      "description": "Filter events to include only changed work items.",
      "supportedResourceVersions": [
        "1.0-preview.2",
        "1.0-preview.1"
      ],
      "inputDescriptors": [
        {
          "id": "areaPath",
          "name": "Area path",
          "description": "Filter events to include only work items under the specified area path.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "workItemType",
          "name": "Work item type",
          "description": "Filter events to include only work items of the specified type.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "hasDynamicValueInformation": true
        },
        {
          "id": "changedFields",
          "name": "Field",
          "description": "Filter events to include only work items with the specified field(s) changed.",
          "inputMode": "combo",
          "isConfidential": false,
          "useInDefaultDescription": false,
          "validation": {
            "dataType": "string"
          },
          "values": {
            "defaultValue": "",
            "possibleValues": [
              {
                "value": "",
                "displayValue": "[Any]"
              }
            ],
            "isLimitedToPossibleValues": true,
            "isReadOnly": true
          },
          "dependencyInputIds": [
            "workItemType"
          ],
          "hasDynamicValueInformation": true
        }
      ]
    }
  ]
}

定义

名称 说明
EventTypeDescriptor

描述事件类型

InputDataType

获取或设置要验证的数据类型。

InputDescriptor

描述订阅的输入。

InputMode

应输入此输入值的模式

InputValidation

描述哪些值对订阅输入有效

InputValue

有关输入的单个值的信息

InputValues

有关给定订阅输入的可能/允许值的信息

InputValuesError

与订阅输入值相关的错误信息。

EventTypeDescriptor

描述事件类型

名称 类型 说明
description

string

事件类型的本地化说明

id

string

事件类型的唯一 ID

inputDescriptors

InputDescriptor[]

特定于事件的输入

name

string

事件类型的本地化友好名称

publisherId

string

此事件类型的发布者的唯一 ID

supportedResourceVersions

string[]

事件的资源有效负载支持的版本。

url

string

此资源的 URL

InputDataType

获取或设置要验证的数据类型。

说明
boolean

表示 true 或 false 的值。

guid

表示 Guid。

none

未指定任何数据类型。

number

表示数值。

string

表示文本值。

uri

表示 URI。

InputDescriptor

描述订阅的输入。

名称 类型 说明
dependencyInputIds

string[]

此输入值所依赖的所有输入的 ID。

description

string

此输入用途的说明

groupName

string

此输入所属的组本地化名称,并可以显示为容器的标头,该标头将包含组中的所有输入。

hasDynamicValueInformation

boolean

如果为 true,则此输入的值信息是动态的,应在依赖项输入的值发生更改时提取。

id

string

订阅输入的标识符

inputMode

InputMode

应输入此输入值的模式

isConfidential

boolean

获取此输入是否为机密,例如密码或应用程序密钥

name

string

本地化名称,可以显示为订阅输入的标签

properties

object

服务提供程序可以使用的输入的自定义属性

type

string

输入值的基础数据类型。 指定此值时,InputMode、验证和值是可选的。

useInDefaultDescription

boolean

获取此输入是否包含在默认生成的作说明中。

validation

InputValidation

用于验证此输入值的信息

valueHint

string

输入值的提示。 它可以在 UI 中用作输入占位符。

values

InputValues

有关此输入的可能值的信息

InputMode

应输入此输入值的模式

说明
checkBox

应显示复选框(对于 true/false 值)

combo

应显示选择/组合控件

none

不应在 UI 中显示此输入

passwordBox

应显示密码输入框

radioButtons

应显示单选按钮

textArea

应显示多行文本区域

textBox

应显示输入文本框

InputValidation

描述哪些值对订阅输入有效

名称 类型 说明
dataType

InputDataType

获取或设置要验证的数据类型。

isRequired

boolean

获取或设置此字段是否为必需字段。

maxLength

integer (int32)

获取或设置此描述符的最大长度。

maxValue

string (decimal)

获取或设置此描述符的最小值。

minLength

integer (int32)

获取或设置此描述符的最小长度。

minValue

string (decimal)

获取或设置此描述符的最小值。

pattern

string

获取或设置要验证的模式。

patternMismatchErrorMessage

string

获取或设置模式不匹配时的错误。

InputValue

有关输入的单个值的信息

名称 类型 说明
data

object

有关此输入的任何其他数据

displayValue

string

要显示此值的文本

value

string

要存储此输入的值

InputValues

有关给定订阅输入的可能/允许值的信息

名称 类型 说明
defaultValue

string

用于此输入的默认值

error

InputValuesError

计算动态值时遇到的错误。

inputId

string

输入的 ID

isDisabled

boolean

应禁用此输入

isLimitedToPossibleValues

boolean

如果该值限制为 PossibleValues (True) 中的值之一,或者是 PossibleValues 中的值只是一个建议(False)

isReadOnly

boolean

应将此输入设为只读

possibleValues

InputValue[]

此输入可以采用的可能值

InputValuesError

与订阅输入值相关的错误信息。

名称 类型 说明
message

string

错误消息。