使用自定义扩展检测和响应 Azure Boards 卡事件

问题描述

我之前已经轻松开发了多个 Azure DevOps Pipelines 自定义任务扩展,有 plenty of information 适合它。

但是,现在我正在尝试开发 Azure Boards 扩展,我找不到任何关于它的文档。

我的要求是:

  • 检测 Azure Board 事件:卡片创建和更新、sprint 开始、sprint 完成、卡片移动到 board 中的另一列...
  • 使用基本身份验证和一些提供的凭据将信息从事件发送到外部系统。

您能否指出一些文档、示例,或者只是说一下如何实现?

更新

我设法使用以下贡献获得卡片创建和更新事件:

  "contributions": [
    {
      "id": "sample-work-item-form-observer","type": "ms.vss-work-web.work-item-notifications","description": "Gets events about the current work item form for the 'Try Me!' toolbar button","targets": [
        "ms.vss-work-web.work-item-form"
      ],"properties": {
        "uri": "myformobserver.html"
      }
    },

还有这个 HTML+JS

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Work item extension page sample</title>
</head>

<body>
<script src="lib/VSS.SDK.js"></script>

<script>
    VSS.init({
        usePlatformScripts: true
    });

    VSS.ready(function () {
        // Register a listener for the work item page contribution.
        VSS.register("sample-work-item-form-observer",function () {
            return {
                // Called when the active work item is modified
                onFieldChanged: function(args) {
                    debugger
                    console.log("changed",args)
                },// Called when a new work item is being loaded in the UI
                onLoaded: function (args) {
                    debugger
                    console.log("loaded",// Called when the active work item is being unloaded in the UI
                onUnloaded: function (args) {
                    debugger
                    console.log("unloaded",// Called after the work item has been saved
                onSaved: function (args) {
                    debugger
                    console.log("saved",// Called when the work item is reset to its unmodified state (undo)
                onReset: function (args) {
                    debugger
                    console.log("reset",// Called when the work item has been refreshed from the server
                onRefreshed: function (args) {
                    debugger
                    console.log("refreshed",args)
                }
            }
        });
    });
</script>
</body>
</html>

这些是我不知道如何实现的点:

  • 当卡片被移入棋盘时接收一个事件(我应该使用什么贡献?我在哪里以及如何接收事件?

enter image description here

  • 在冲刺开始/结束时接收事件

  • 使用 url + 凭据获取对预配置服务连接的引用,以将事件信息发送到我的后端。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)