TFS 具有默认的 slack 服务挂钩,可以将消息发布到频道。API 如下所示:
POST http://tfsserver:8080/tfs/DefaultCollection/_apis/hooks/subscriptions?api-version=3.2
Content-Type: application/json
{
"consumerActionId":"postMessageToChannel",
"consumerId":"slack",
"consumerInputs":{
"url":"https://hooks.slack.com/services/xxxxxx"},
"eventType":"workitem.created",
"publisherId":"tfs",
"publisherInputs":{
"areaPath":"",
"workItemType":"",
"projectId":"77e3c775-dc30-4354-xxxx-xxxxxxxxxxxx"}
}
对于您的第二个要求,您需要检查 Slack Api 以了解如何读取频道的所有历史记录,并使用Update work items更新 Bug 工作项。