0

i wanted to modify task.json on runtime means when i configure my CI task in vsts or tfs.

I created an extension that contribute a build task. Through this build task i wanted to do something like this, i have done in jenkins. Please Refer screenshot: Jenkin ScreenShot

1-Requirement) in this image we add global variable(fields) at runtime on clicking Add Global Variables button. It generates two fields one for GVName and another for its value.

2-Requirement) When we select global variable then respective value field change at runtime means it can be dropbox(picklist) or input field that depends on GV type.

3-Requirement) On Job design time we make an ajax call to server that return true/false on based of value we shows error like in image 2.

Is these requirements are feasible in VSTS task.json? If yes, can you help me to solve this.

enter image description here

Nitin Parashar
  • 227
  • 3
  • 13

1 Answers1

0

No, but it can list the available items that returned from the server.

For example:

"inputs": [
 {
      "name": "APIURL",
      "type": "connectedService:Generic",
      "label": "API URL",
      "required": true,
      "helpMarkDown": ""
    },
      {
        "name": "List1",
        "type": "pickList",
        "label": "List4",
        "defaultValue": "",
        "required": false,
        "helpMarkDown": ""
      }
  ],
  "sourceDefinitions": [
    {
      "target": "List1",
      "endpoint": "home/jsontest",
      "selector": "jsonpath:$[*].id",
      "authKey": "$(APIURL)"
    }
  ],

A thread that may benefit you: Using a web API in task.json to fill picklists buildtask

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53