Run Condition - Complex Syntax

Hey folks,
I’m struggling to get a Run Condition that is based off a Complex Syntax, as defined in [https://octopus.com/docs/deployment-process/variables/variable-substitution-syntax](http://variable substitution syntax) to run successfully.

The error received is

Error converting value “Variable” to type ‘Octopus.Client.Model.DeploymentStepCondition’. Path ‘Steps[7].Condition’, line 290, position 30…

We’re running v2018.7.0 and the variable expression is as follows:

#{if Octopus.Deployment.CreatedBy.Username != 'System'}true#{/if}

Am I goofing something here or is this a known issue/limitation with a Run Condition?

Thanks,
Patrick

I use the following complex syntax and it works fine. Perhaps you need to have “System” be enclosed in double quotes instead of single quotes?

#{if slackChannelName}
#{if Octopus.Release.Channel.Name == “Data Only”}False#{/if}
#{unless Octopus.Release.Channel.Name == “Data Only”}True#{/unless}
#{/if}
#{unless slackChannelName}False#{/unless}

Chris,
Thanks for the assist/attempt.

Turns out it’s not the configuration of octopus or the conditional at all, well maybe the double quotes.

BUT the real issue looks to be Octo.exe is dated (3.3.16) and knew nothing of how to handle the conditional syntax.

After some more spelunking, I came across https://help.octopusdeploy.com/discussions/problems/50625-creating-release-with-a-multi-step-conditional-trigger which helped isolate my particular issue.

Regardless, thanks.

Hi Patrick,

Thanks for getting in touch! And thanks @Chris_Camburn for stopping by to help. :slight_smile:

So it sounds like you found the problem here. Has updating Octo.exe resolved your run condition issue?

Let me know if you are still having trouble with this. :slight_smile:

Best regards,
Daniel

Daniel,
Yeah, an outdated Octo.exe looks to be the issue. Thanks for the follow up however.

Hi Patrick,

No worries, thanks for the update.

Please feel free to get in touch at any time. :slight_smile:

Best regards,
Daniel

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