I’ve been using the code snippet found in the Octopus Documentation here to create and update variables programmatically with the REST API. This is working perfectly.
However I can’t seem to work out how to set the variable scope via the same API. Specifically, I’m trying to set the Environment field to bind the value to the “Development” environment.
I’ve uploaded a copy of my script (without sensitive information), with my attempt at adding the scope property to the payload. I’ve also added a screenshot of the code in case it’s easier to read that way.
Would someone be able to tell me where I’ve gone wrong here please? I can’t find any page in the documentation or anywhere on Stackoverflow etc. that illustrates this.
Set-Variables.ps1 (2.0 KB)
Thanks very much.