Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding paramters to VSTS Task Group

Tags:

azure-devops

I have a Task Group that I created out of a set of build tasks. I am able to edit the tasks quite well, but i now realise i will need to add another parameter to the task group. How do I go about doing that?

like image 789
avsln Avatar asked Jun 27 '18 22:06

avsln


2 Answers

Task group parameters are automatically created based on the variables used in the tasks. If you reference a new variable in a task that's within a task group, it will pop up.

like image 75
Daniel Mann Avatar answered Sep 18 '22 15:09

Daniel Mann


In addition to the accepted answer, if you want to add parameters that are not directly referenced by tasks within the tasks group (e.g. to use in a config file token replacement task) then you can export your task group, edit the .json file then import it back in. The parameters are in an inputs array near the end of file. You can also hide parameters here if you only want to use them internally to the task group by setting a default value and adding a 'visibleRule' property, see this article for details: https://medium.com/objectsharp/how-to-hide-a-task-group-parameter-b95f7c85870c

This will create a new task group rather than updating your current task group. If you want to update the task group, you can use this REST API: https://docs.microsoft.com/en-us/rest/api/azure/devops/distributedtask/taskgroups/update?view=azure-devops-rest-5.1

like image 20
Branstar Avatar answered Sep 19 '22 15:09

Branstar