A good way to get started will be to open the network tab on your browser and do some variable changes via the UI and see what calls are made, you’ll need to write code C#/powershell/etc to do the actions you are after to update the state of the variables in Octopus.
Let us know if you hit any specific issues, comparing your calls to those generated by the UI will be your best bet to write/debug your variable manipulation code.
I have created a poweshell script to get the values from csv file and create variables with respect Name,Value and scope.
Now if I add new variable name,value and scope in the same csv and execute same ps1 all variables are creating again and I can see duplicate values from Octopus UI.
I need some logic in ps1 which ignore to create variables already exist in variableset, and create only new variable which are not in variableset when iterating the csv file.
please find my script and csv file. Can you help me on this.