在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
,但不知道如何。
答案 0 :(得分:0)
试试这段代码:
{
"name": "SiteUrl",
"type": "string",
"label": "SiteUrl",
"defaultValue": "",
"required": true,
"helpMarkDown": "The url to the site.",
"visibleRule": "Wakeup = true",
"groupName": "advanced"
}