"Send an Email" step renders Actions disordered


We are using Email step to send an email in HTML about the Actions performed in the deployment using the examples in documentation (https://octopus.com/docs/deployment-process/steps/email-notifications#Emailnotifications-Addinganemailstep).

In the latest versions of Octopus, Actions in the loop do no appear in the same order as in the Process/Deployment.

This is the fragment we are using to render the Actions (same as in the documentation link above)

  #{each action in Octopus.Action}
    <li><strong>#{action.Name}</strong> #{if action.Package.NuGetPackageId}&mdash; <a href="http://nuget.org/packages/#{action.Package.NuGetPackageId}">#{action.Package.NuGetPackageId}</a> <em>version #{action.Package.NuGetPackageVersion}#{/if}</em></li>

Now we are using Octopus v2018.2.7 but it happened also with version v2018.1.1

Hi, thanks for getting in touch.

Unfortunately, it iteration order of an indexed variable ends up being a consequence of the Dictionary in which we store the variables and values. It’s a bit to take in, but you can see the workings in Octostache which is our open source engine that does the variable evaluations. It’s a generic library, so it knows nothing of Action orderings.

Admittedly, it’s not perfect that the ordering in an email like this isn’t correct. If it’s enough of an issue for you, you’re welcome to add a suggestion to our uservoice site and we’ll take it into consideration.


Hi Michael:

Thanks for the quick response.

Ordering of actions worked fine in previous versions of Octopus (Before 4.0). I am not telling this is a bug of Octostache, just telling it is a change of behaviour and thus, it is not the expected behaviour for us.

I will suggest that you reflect in the documentation (https://octopus.com/docs/deployment-process/steps/email-notifications#Emailnotifications-Addinganemailstep) that the actions or steps are not iterated in order cause example maybe missleading.


Hi Julia,

I’ve been digging into this some more and we might have changed something (on Octopus, rather than OctoStache) that was giving us a stable ordering just as a consequence of the order we add the variables - would at least be nice to get the old behaviour back.

Can you provide a screen shot of step ordering and mail output order? (Feel free to mark the conversation as private if you need) And let me know the last version it was giving the right order for you. I’ll dig into it further and see what’s changed.


Hi Michael,

Thanks for looking again.

The last version that was giving the right order for us was 3.12.0 (we updated from that version to version 4.0.4).

And the screenshots (one per post)

Julia AgudoThis text will be hidden

Email screen shot:

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