Variable prompt issue - version 2.3.3.1369

I can’t seem to get the variable prompt to work.
When I go to deploy the project, it prompts me like it should, but when I try to read the variable in a script file like so:

$myVar = $OctopusParameters[“prompt”]

it’s blank everytime. Is there something I’m doing wrong?

Hi Michael,

Thanks for the post. Could you attach some screenshots of:

  1. Your project Variables tab where the prompted variable is defined
  2. The deployment page showing where you enter the variable
  3. The deployment process showing the step where your PowerShell script lives that uses the variable

Paul

This includes several libraries as well. I’ve also tried using a variable name “testprompt” and that didn’t come across either.

On a side note, I did create a new simple project and tried it and it worked fine. My next step will be to recreate the larger deployment project and see if it might be because it was an older project (it was created just after 2.0 release)

Actually, I think I found the bug. When I scope the variable by a role, it comes across as blank. When I remove the role, it works. (It works with environment scope.)
This is the same role that the process steps are scoped to. (Even creating a simple project repeats this result.)

Also, I failed to appropriately scrub the “steps.png” image in the previous comment. Could you please remove that image from public view? Thanks.

Hi Michael - image removed.

Thanks for the follow-up with additional detail. I think this is an intentional limitation in prompted variables that we should make clearer via the UI, but we’ll need to consider it more closely. For now creating an additional variable, and #{…} substituting the value into the role-scoped one, will let you work around it.

Issue here:

Regards,
Nick

Thanks Nick. I didn’t even think about doing that. That should be enough to get me around my issue.