I see a few items about getting variables from previous steps in a project but can’t get it working in a RunBook. Is there a different way to go this in a run book?
I have a project variable set on the project scoped to the runbook process named “EndPoints”
From Powershell Script in first step
Set-OctopusVariable -name “EndPoints” -value $global:EndPoints
From Body section in next step
#{Octopus.Action[ADCleanupScript].Output[EndPoints].WorkItems}
Thanks for reaching out on our community forum. You’ve set a variable in step one and are trying to access it in step 2. The issue is that you’ve defined the variable as ‘EndPoints’ in step 1, then in step two, based on your structure, you’re trying to access the var WorkItems on a deployment target called ‘EndPoints’.
That structure is for referencing a var set on a deployment target, like if a test passed or failed. More info on that is shown here.
If you want to reference your EndPoints variable in step 2, you’d want to use this: #{Octopus.Action[ADCleanupScript].Output.EndPoints}