VSTS 输入依赖于其他输入

VSTS input dependent on other input

在 VSTS 任务中,我有几个输入。我想使输入依赖于另一个。我的相关部分JSON如下:

 "inputs": [
        {
            "name": "Wakeup",
            "type": "boolean",
            "label": "Wakeup",
            "defaultValue": "false",
            "required": false,
            "helpMarkDown": "Makes a wake-up request to the site after deploying.",
            "groupName": "advanced"
        },
        {
            "name": "SiteUrl",
            "type": "string",
            "label": "SiteUrl",
            "defaultValue": "",
            "required": false,
            "helpMarkDown": "The url to the site.",
            "groupName": "advanced"
        }
    ]

如果选择Wakeup,则需要SiteUrl。但是,如果 Wakeup 未被选中,SiteUrl 甚至不应该为用户编辑(如果可能的话)。

我一直在查看 build task-schema,但无法弄清楚。我想我应该可以使用 visibleRule,但不知道如何使用。

试试这个代码:

{
      "name": "SiteUrl",
      "type": "string",
      "label": "SiteUrl",
      "defaultValue": "",
      "required": true,
      "helpMarkDown": "The url to the site.",
      "visibleRule": "Wakeup = true",
      "groupName": "advanced"
    }