0

Regarding: https://github.com/Microsoft/vsts-tasks

Is it possible to create a task that acts like the Get sources Workspace mappings, where I can have an [+ Add] button to add as many values as needed?

here is an example

I've been looking through documentation and sample blogs, but all examples I find have a pretty basic task.json. And I haven't found another task to add that has this functionality.

Thanks!

Thad Peiffer
  • 638
  • 1
  • 7
  • 22
  • The map workspaces isn't really a VSTS task, it's more of a custom UI that wraps around the `TF` tool. I haven't found any way to achieve this as of yet. To get around this, I have my VSTS task point to a JSON file which can be dynamic and the task works with it as necessary. – tj-cappelletti Feb 07 '18 at 19:44
  • That is what I was assuming as well. Was really hoping that wasn't the case, though, as it would be very handy for a number of tasks. – Thad Peiffer Feb 07 '18 at 19:58
  • I agree. You can always suggest it in the user voice forum. https://visualstudio.uservoice.com/forums/330519-visual-studio-team-services – tj-cappelletti Feb 07 '18 at 20:00

1 Answers1

1

This cannot be achieve. The "Add" option you see is not for build tasks just as virusstorm mentioned.

For build tasks, you can only specify a fixed number of inputs in the task.json. We are working on adding dictionary input which may help you with this kind of issues.

Refer to these links for details:

Support complex input types

Multiple task inputs

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • Eddie, that is the conclusion I have come to. As your response has links pointing to the issue being discussed I will mark it as the answer. Do you know the ETA for dictionary inputs? The "it's coming" comments from those links were from over a year ago. – Thad Peiffer Feb 12 '18 at 19:37
  • Do you mind taking a look at a similar question: https://stackoverflow.com/questions/68096837/azure-pipeline-custom-task-with-an-unknown-number-of-inputs – CodeMonkey Jun 23 '21 at 10:40