Run Condition: Variable

Mike Jacobs's Avatar

Mike Jacobs

15 Feb, 2017 01:38 PM

We have started using the "Run condition: only run when the variable expression is true" as a way to control whether a step should run based on a combination of Tenants and Environments (since the list of valid Tenants is different in each Environment, I cannot simply add a Tenant Group filter on the step, but need the greater flexibility of an Octo Variable.)

However, this has the unfortunately side-effect of the step running ONLY based on the variable; it no longer cares whether earlier steps ran successfully or not (since selecting Run condition:Variable is unselecting the Success or Failure choices.)

This is a problem for us, in that these steps are now running even when there has been a failure in an earlier step, which we do not want.

What we need is either: make Run condition: Variable separate from Run condition: Success/Failure/Always; or create new entries SuccessAndVariable, FailureAndVariable.

Thanks for your help.

  1. Support Staff 1 Posted by Henrik Andersso... on 17 Feb, 2017 12:31 AM

    Henrik Andersson's Avatar

    Hi Mike,

    Thanks for getting in touch and for the suggestion!

    We've raised this issue to have your suggestion implemented.

    Again, many thanks for the suggestion.

    Thank you and best regards,

  2. 2 Posted by chris.camburn on 17 Feb, 2017 01:24 AM

    chris.camburn's Avatar

    As a workaround for anyone who needs it, until this gets added, the following will work:

    To run only on success and variable truthiness:

    #{unless Octopus.Deployment.Error}#{PromptedVariable}#{/unless}

    To run only on failure and variable truthiness:

    #{if Octopus.Deployment.Error}#{PromptedVariable}#{/unless}

  3. Support Staff 3 Posted by Henrik Andersso... on 17 Feb, 2017 01:38 AM

    Henrik Andersson's Avatar

    Thanks Chris for posting that workaround!

    Many thanks,

  4. 4 Posted by Mike Jacobs on 17 Feb, 2017 04:10 PM

    Mike Jacobs's Avatar


    I found that work-around on the board shortly after posting. It works, but I'd still want the more direct way of doing on the step.

  5. Paul Stovell closed this discussion on 19 May, 2017 10:42 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac