Octopus CLI create-release set variable value error

Hi,

I’m using octopus CLI to create a release from the Jenkins pipeline using the below command:

“C:\Program Files\Octopus Deploy\Octopus\CLI\dotnet-octo.exe” create-release
–project Messenger
–deployto=Development
–version 1.0.9
–server https://***:86
–apiKey ****
–releaseNotesFile=C:\Jenkins\workspace\Messenger@tmp\config4333649249949313392tmp
–variable=“PinpointConfig:UsePinpoint”:“no”"

and I got the below error message:
System.ArgumentException: Please provide a variable for the prompted value PinpointConfig:UsePinpoint

where PinpointConfig:UsePinpoint is a prompt variable in the Octopus project used for JSON replacement.

Any help would be really appreciated.

Thanks,
Costi

Hi Costi,

Thanks for reaching out and welcome to the forums.

Because PinpointConfig:UsePinpoint is your variable name, this unfortunately won’t work with Octopus CLI. The issue is that the : character tells Octopus to stop parsing, it believes the variable name is PinpointConfig, and the value is UsePinpoint. Are you able to change the name to PinpointConfig.UsePinpoint? Typically speaking, we advise using dots in these situations.

Looking forward to hearing back and what you think.

Best,
Jeremy

Thanks Jeremy for your quick reply.
I was confused by the documentation, and I tried to use the backslash in many combinations but without any success.
In the end, I create a new prompt variable without : and I use it to populate the value for my JSON variable. As one of my colleagues said, it was an ugly hack, but I did not find another way to make it work.

Hi @petrecostinel.baicu,

You’re very welcome. I hadn’t considered the fact that the variable requirement for JSON structured variable replacement is a :. I’m going to have some internal discussions about this. I’ll get back to you if we come up with a nice solution.

Best,
Jeremy

Hey @petrecostinel.baicu,

One of my colleagues said this should work if you use a variable label and the label doesn’t have the : in it.

For example:

Can you please try making the label PinpointConfigUsePinpoint(or some variation you prefer that doesnt have a :) and then in your create-release do --variable=PinpointConfigUsePinpoint:no and see if it works okay for you?

Best,
Jeremy

Hi Jeremy,

Sorry for the delay, I’ve tested the proposed “work-around” solution this morning, and it works.
Appreciate.

Cheers,
Costi

Hey Costi,

No worries and you’re very welcome!

Thank you for letting me know you’re in a good spot. I hope you have a good week. We’re here if you run into any other issues going forward.

Best,
Jeremy

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.