Variable Condition

Conditions - Octopus Deploy mentions:
You can use the following expression to run a step only when the deployment is successful and when a variable evaluates to true:
#{unless Octopus.Deployment.Error}#{Variable}#{/unless}

Does Octo support a way where I can run the step if Deployment is successful but variable equates false?
something like
#{unless Octopus.Deployment.Error}#{!Variable}#{/unless} ?

Hey @Naman.Kumar

Thanks for your getting in touch and your question!

The answer is yes, you can do this. The way it works is similar to the way you’ve shown, but if you specifically want to test the value (false in your case), then you can do something like this with a variables named MyVariableValue:

#{unless Octopus.Deployment.Error}#{if MyVariableValue == "false"}true#{/if}#{/unless}

An alternative to testing for the value explicitly is to use the unless keyword again. As it evaluates true when the value is falsy you can do this:

#{unless Octopus.Deployment.Error}#{unless MyVariableValue}true#{/unless}#{/unless}

I hope that helps!