2017-08-08 136 views
0

在VSTS任務中,我有幾個輸入。我想讓輸入依賴於另一個輸入。下面我JSON的相關部分:VSTS輸入取決於其他輸入

"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

試試這個代碼:

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