Step template package parameter not usable because it is "not used by the step" even though I'm referencing it

There seems to be a bug with using package parameters in step templates, where Octopus can’t seem to detect that a package parameter is used, and thus refuses to let you choose a package for the parameter when using the step template.

Repro steps:

  1. Create a step template, choosing “Run a script” as the base step.
  2. Add a parameter “MyPackage” with the control type “Package”.
  3. In the step’s “Script source”, choose “Script file inside a package”
  4. Enable “Bind” on Package ID, and set #{MyPackage.PackageId} as the value. Script filename and script parameters doesn’t really matter at this point. Save it.
  5. Try to add this step template to any deployment process. It won’t let you select a package, saying
    This parameter is not used by the step
    This parameter is not currently used by the step, it might have been replaced by another parameter.

The workaround seems to be to just add an “Additional package” and choose “Let the project select the package”, and choose the package parameter.

This does seem like a bug though.

Hi @hallgeir.osterbo,

Thanks for reaching out and raising this with us, cheers for all the provided details and workaround too!

I agree that it looks like there’s a bug here and I’ve managed to reproduce it on my end using version 2023.3.4541:

I’ll dig into it to see if I can spot what’s going on and keep you posted with any updates or when a Github issue is raised for it.

Thanks again for pointing it out to us, feel free to reach out with any questions at all!

Best Regards,

1 Like

Hi,

Is there any update on this as I’m having the same issue when trying to create a new Project containing a a step using a new custom step template with a package parameter.

Hey @marc,

Thank you for reaching out and I am sorry you are also seeing this issue, I took a look at the engineering conversations surrounding this that Finnian has initiated and the engineers are still discussing this internally, we have also reached out to another team to see if they have any ideas.

I will pop a note in both of those threads to say you are also seeing this behaviour when using the package parameter in a new project containing a custom step template.

Hopefully we will have some more details for you both soon.

Kind Regards,
Clare

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