Skip to content

Feature Request: ElseIf #92

Description

@ay-azara

Hey Octo Crew, would adding an elseif be possible?

Below is an example from Variable Substitutions.

#{if Octopus.Environment.Name == "Development"}
  Do this if it's Development
#{else}
  #{if Octopus.Environment.Name == "Test"}
    Do this if it's Test
  #{else}
    Do this if it's neither
  #{/if}
#{/if}

If I understand it right, every extra if has to be nested and would quickly get out of control. It would be nice to express complex checks as.

#{if Octopus.Environment.Name == "Development"}
  Do this if it's Development
#{elseif Octopus.Environment.Name == "Test"}
  Do this if it's Test
#{else}
  Do this if it's neither
#{/if}

Probably not wise to add too many conditions but what's missing from the examples when it comes to run conditions is one level of #{if Octopus.Deployment.Error == "True"}False{/if} because you can't use "Variable Conditions" without disabling "Success: only run when previous steps succeed"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions