Step template $OctopusParameters workings

I’ve got a custom step template that takes in a parameter “ResourcesPath” for a path to a folder.
The process contains this step template twice. Once to call it with one variable A, the other to call with another variable B.
However, the second time this step is called in the process, instead of using value of variable B it’s using value of variable A.

The reason (so it seems after testing) is that I also have a project variable named “ResourcePath”.
Instead of using the value set in the step parameter, the variable is used.
After renaming the step parameter from “ResourcesPath” to “ResourcePathX”, the values for the second call is correct.
So $OctopusParameters['ResourcesPath'] first resolves the project variable, and only then looks at the values set in the step itself.

Is this a bug or by design?

Hi David,

Thanks for getting in touch. This is one of the complexities when layering variables from multiple different sources, and it is a known behaviour (and potential confusion) when using Octopus and Step Templates.

My recommendation is to ensure you are using different names for your Step Template parameters and the Project Variables. This will avoid any potential confusion.

In Octopus 3.4 we are building some tooling to make it easier to diagnose variables, but in the meantime I make a habit of naming variables uniquely in each layer of Octopus (Library, Templates, Projects).

Hope that helps!

Thanks for clearing this up.
I have already given a very specific name to the step template variable, so issue has been averted.