Skip to content

--variable=VALUE argument seems to be ignored in the CreateRelease TeamCity Step #204

Description

@Clare-Octopus

Version

TC Plugin - 6.3.0
CLI - 9.1.7
Octopus Version - 2026.2.13126

What happened?

Setting the --variable=VALUE argument in the Additional command line arguments field in an OctopusDeploy: Create release step does not seem to actually set the value of the prompted variable in the release. The flag is valid for a CreateRelease step as per our documentation here.

Image


This results in an error when trying to deploy the release via TeamCity:

System.ArgumentException: Please provide a variable for the prompted value ImageTag

I have tried a number of different ways to type the variable into the Additional command line arguments field for example --variable "ImageTag:1.5.2" and --variable 'ImageTag:1.5.2' but nothing seems to work in TeamCity.

Whats odd is that if you put basically the exact same code directly into the same octo CLI version in command prompt, it will create the release and respect the --variable flag:

TeamCity command -

octo.exe create-release --server http://192.168.0.201/ --apikey SECRET --space Default --project "TC Prompted variable" --enableservicemessages --version 1.0.4 --deployto Dev --progress --variable ImageTag:1.5.2

Old CLI command (the exact same CLI version TC is using) -

octo.exe create-release --server http://192.168.0.201/ --apikey SECRET --space Default --project "TC Prompted variable" --enableservicemessages --version 0.0.5 --deployto Dev --progress --variable ImageTag:1.5.2

In my project, I have a Run a Script step with a simple PowerShell Write-Host "$ImageTag" script. ImageTag being the prompted Project variable. You can see the release deploys and prints out the variable value from the CLI code when running directly through the CLI (not TeamCity):

Image

More Information

Initial customer ticket (Internal) - https://octopuscd.zendesk.com/agent/tickets/208482
RnD (Internal) - https://octopusdeploy.slack.com/archives/CNHBHV2BX/p1781689481192679

Workaround

Please see my comment below for the fix for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions