Octopus.Release.PreviousForEnvironment.Number empty

Upgraded to the latest version from 3.4.13. Actually, what I did was setup a new instance, imported an export from the old instance and then upgraded the new one.

We have some steps in a tenanted project that need the Octopus.Release.PreviousForEnvironment.Number, but it is empty. Why is that not filled out?

Hi Daniel,

Thanks for getting in touch! I’m sorry to hear you’re hitting this strange behavior after upgrading. Unfortunately I haven’t been able to reproduce this on latest - this variable gets populated in my testing. Would you be able to provide a copy of your verbose deployment logs with debugging variables enabled to shed some more light on what could be causing this? The following doc page outlines how you can produce and export this log.

I look forward to hearing back and getting to the bottom of this one!

Best regards,


Thanks for the followup,

I don’t think we can duplicate this. What our step does is duplicate a database with a new version name, so that MyDatabase.1.0 gets copied to MyDatabase.1.2.

We use a template variable for that with this value:

Version.PreviousForEnvironment =

#{if Octopus.Release.PreviousForEnvironment.Number}#{Octopus.Release.PreviousForEnvironment.Number}#{/if}

If it is the first deployment, the databases are not versioned at all yet, so this syntax works for that.

When we saw in the log that the step could not find database MyDatabase (with no version number) we were able to set the variable and move forward. That was several deployments ago and I do not see that in the dashboard anymore. Also, we did not have the showVariables set until the next deployment when we wanted to monitor more fully.




Senior Software Engineer


100 E-Business Way, Suite# 320 | Cincinnati OH 45241

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