【问题标题】:VSTS input dependent on other inputVSTS 输入依赖于其他输入
【发布时间】:2017-08-08 17:19:40
【问题描述】:

在 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,但不知道如何。

【问题讨论】:

    标签: azure-pipelines azure-pipelines-build-task


    【解决方案1】:

    试试这个代码:

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

    【讨论】:

      猜你喜欢
      • 2017-09-09
      • 2022-08-05
      • 2023-02-09
      • 2016-06-18
      • 1970-01-01
      • 2022-01-15
      • 1970-01-01
      • 2019-07-16
      • 2015-09-21
      相关资源
      最近更新 更多