Skip to content

Conversation

@bec-callow-oct
Copy link
Contributor

@bec-callow-oct bec-callow-oct commented Jan 22, 2026

Replaces old V1 tenant variable CLI and script examples with new examples using the new endpoints.

[SC-120884]

Testing

Tested the following for both project and common tenant variables scripts:

  • Create and update for non-sensitive variables
  • Create and update for sensitive variables
  • Create and update for sensitive variables with bound variables

Verified that all CLI examples are current and working.

Common tenant variables script execution

.\PowershellOctClient.ps1
Found common variable template: template1 (Template ID: 1f0f0856-ebc2-4fe6-a42f-ffc965fa5deb, Library Variable Set ID: LibraryVariableSets-1)
Updated variable value to '22/01/26 - client 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 1e0da49f-9f8b-4049-9518-c79c64227a9c, Library Variable Set ID: LibraryVariableSets-2)
Updated variable value to '22/01/26 - client 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 8ebba7fb-3075-4405-8483-5539892d16e1, Library Variable Set ID: LibraryVariableSets-3)
Updated variable value to '22/01/26 - client 1' for environments: Environments-21, Environments-22, Environments-23
Successfully updated common tenant variables
.\PowershellRestApi.ps1
Found common variable template: template1 (Template ID: 1f0f0856-ebc2-4fe6-a42f-ffc965fa5deb, Library Variable Set ID: LibraryVariableSets-1)
Updated variable value to '22/01/26 - api 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 1e0da49f-9f8b-4049-9518-c79c64227a9c, Library Variable Set ID: LibraryVariableSets-2)
Updated variable value to '22/01/26 - api 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 8ebba7fb-3075-4405-8483-5539892d16e1, Library Variable Set ID: LibraryVariableSets-3)
Updated variable value to '22/01/26 - api 1' for environments: Environments-21, Environments-22, Environments-23

Successfully updated common tenant variables
python .\Python.py
Found common variable template: template1 (Template ID: 1f0f0856-ebc2-4fe6-a42f-ffc965fa5deb, Library Variable Set ID: LibraryVariableSets-1)
Updated variable value to '22/01/26 - Python 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 1e0da49f-9f8b-4049-9518-c79c64227a9c, Library Variable Set ID: LibraryVariableSets-2)
Updated variable value to '22/01/26 - Python 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 8ebba7fb-3075-4405-8483-5539892d16e1, Library Variable Set ID: LibraryVariableSets-3)
Updated variable value to '22/01/26 - Python 1' for environments: Environments-21, Environments-22, Environments-23
Successfully updated common tenant variables
dotnet-script .\CSharp.cs
Found common variable template: template1 (Template ID: 1f0f0856-ebc2-4fe6-a42f-ffc965fa5deb, Library Variable Set ID: LibraryVariableSets-1)
Updated variable value to '22/01/26 - C# script 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 1e0da49f-9f8b-4049-9518-c79c64227a9c, Library Variable Set ID: LibraryVariableSets-2)
Updated variable value to '22/01/26 - C# script 1' for environments: Environments-21, Environments-22, Environments-23
Found common variable template: template1 (Template ID: 8ebba7fb-3075-4405-8483-5539892d16e1, Library Variable Set ID: LibraryVariableSets-3)
Updated variable value to '22/01/26 - C# script 1' for environments: Environments-21, Environments-22, Environments-23
Successfully updated common tenant variables

Project tenant variables script execution

python .\Python.py
Found project variable template: template1 (Template ID: e2662f09-c666-4c37-9b14-5e163f238989, Project ID: Projects-43)
Updated variable value to '22/01/26 - Python' for environments: Environments-21, Environments-22, Environments-23
Found project variable template: template1 (Template ID: 7567b3cd-26b2-4485-a0b7-cab4362d9a6a, Project ID: Projects-41)
Updated sensitive variable for environments: Environments-21, Environments-22, Environments-23
Found project variable template: template1 (Template ID: 476a69e6-5d5b-4e3d-b64f-7ea8c409a96a, Project ID: Projects-42)
Updated variable value to '22/01/26 - Python' for environments: Environments-21, Environments-22, Environments-23
Successfully updated project tenant variables
.\PowershellRestApi.ps1
Found project variable template: template1 (Template ID: e2662f09-c666-4c37-9b14-5e163f238989, Project ID: Projects-43)
Updated variable value to '22/01/26 - api 1' for environments: Environments-21, Environments-22, Environments-23
Found project variable template: template1 (Template ID: 476a69e6-5d5b-4e3d-b64f-7ea8c409a96a, Project ID: Projects-42)
Updated variable value to '22/01/26 - api 1' for environments: Environments-21, Environments-22, Environments-23
Found missing project variable template: template1 (Template ID: 7567b3cd-26b2-4485-a0b7-cab4362d9a6a, Project ID: Projects-41)
Created variable value '22/01/26 - api 1' for missing template
Successfully updated project tenant variables
dotnet-script CSharp.cs
Found project variable template: template1 (Template ID: e2662f09-c666-4c37-9b14-5e163f238989, Project ID: Projects-43)
Updated variable value to '22/01/26 - C# script' for environments: Environments-21, Environments-22, Environments-23
Found project variable template: template1 (Template ID: 7567b3cd-26b2-4485-a0b7-cab4362d9a6a, Project ID: Projects-41)
Updated sensitive variable for environments: Environments-21, Environments-22, Environments-23
Found project variable template: template1 (Template ID: 476a69e6-5d5b-4e3d-b64f-7ea8c409a96a, Project ID: Projects-42)
Updated variable value to '22/01/26 - C# script' for environments: Environments-21, Environments-22, Environments-23
Successfully updated project tenant variables

# Handle sensitive values
if($missingVariable.Template.DisplaySettings["Octopus.ControlType"] -eq "Sensitive") {
if($NewValueIsBoundToOctopusVariable -eq $True) {
$variableEntry.Value = $newValue
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This existed in the original project tenant variable scripts and allows values to be viewed as text within a secret field

image

@bec-callow-oct bec-callow-oct marked this pull request as ready for review January 22, 2026 06:06
@bec-callow-oct bec-callow-oct merged commit 9457be9 into main Jan 23, 2026
5 checks passed
@bec-callow-oct bec-callow-oct deleted the fnm/fix-tv-docs branch January 23, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants