Run Condition always False

In my deployment I am using run condition “Variable: only run when the variable expression is true”
This is because we are migrating our services to a new queuing system and need to deploy to a site whom are migration to this new version of the service.

Am i misunderstanding the description?

I have this condition where if i set my variable
UseLegacyDeploymentProcess=false

This should return the expression as true to the run condition
#{/if UseLegacyDeploymentProcess}false#{/if}

But i am getting false no matter if i set the value as true or false.
it is always false.

I know i could use
#{unless UseLegacyDeploymentProcess }true#{/unless}
and my step will run but that become a double negative it is also confusing to red for the none technical people.

Hi David,

Thanks for getting in touch!

I can see an additional ‘/’ before your if statement, is that just a typo in your post or did the step also have this? If so, can you try without that?
In the meantime, I’ll spin up a test environment using this data to check everything out.

Regards,
Paul

Hi David,

The documentation here sheds a bit of light on this. The variable expression as you currently have it is only checking whether the variable named ‘UseLegacyDeploymentProcess’ exists, it isn’t checking the value assigned to it.
To do that, you would have to add a ‘==’ or ‘!=’ type expression and the desired value.
e.g.
#{if UseLegacyDeploymentProcess == “false”}true#{/if}

With this, if the project variable is “false”, then the step will run; if it is “true” it will not. You can amend as necessary for your needs.

Regards,
Paul

Hi Paul

yes the / is a type on my part in the post.

the solution you put in makes more sense so will try that and report back
Thanks for the quick replay

1 Like