Runbook Id and Name not in OctopusParameters in powershell

I have a powershell script where I want to get the name and Id of the RunBook, but they return empty. It seems that they are not mapped to the powershell parameters list. We are running version 2019.11.1.

image

To get these, I used step template with the below script:

write-host "Octopus.Runbook.Name= " $OctopusParameters["Octopus.Runbook.Name"]
write-host "Octopus.RunbookRun.Comments= " $OctopusParameters["Octopus.RunbookRun.Comments"] 
write-host "Octopus.RunbookRun.Created= " $OctopusParameters["Octopus.RunbookRun.Created"] 
write-host "Octopus.RunbookRun.CreatedUtc= " $OctopusParameters["Octopus.RunbookRun.CreatedUtc"] 
write-host "Octopus.RunbookRun.ForcePackageDownload= " $OctopusParameters["Octopus.RunbookRun.ForcePackageDownload"] 
write-host "Octopus.RunbookRun.Id= " $OctopusParameters["Octopus.RunbookRun.Id"] 
write-host "Octopus.RunbookRun.Name= " $OctopusParameters["Octopus.RunbookRun.Name"]
write-host "Octopus.RunbookRun.PreviousSuccessful.Id= " $OctopusParameters["Octopus.RunbookRun.PreviousSuccessful.Id"]
write-host "Octopus.RunbookSnapshot.CurrentForEnvironment.Id= " $OctopusParameters["Octopus.RunbookSnapshot.CurrentForEnvironment.Id"] 
write-host "Octopus.RunbookSnapshot.CurrentForEnvironment.Name= " $OctopusParameters["Octopus.RunbookSnapshot.CurrentForEnvironment.Name"]
write-host "Octopus.RunbookSnapshot.Id= " $OctopusParameters["Octopus.RunbookSnapshot.Id"] 
write-host "Octopus.RunbookSnapshot.Notes= " $OctopusParameters["Octopus.RunbookSnapshot.Notes"]
write-host "Octopus.RunbookSnapshot.Previous.Id= " $OctopusParameters["Octopus.RunbookSnapshot.Previous.Id"] 
write-host "Octopus.RunbookSnapshot.Previous.Name= "  $OctopusParameters["Octopus.RunbookSnapshot.Previous.Name"] 
write-host "Octopus.RunbookSnapshot.PreviousForEnvironment.Id= " $OctopusParameters["Octopus.RunbookSnapshot.PreviousForEnvironment.Id"] 
write-host "Octopus.RunbookSnapshot.PreviousForEnvironment.Name= " $OctopusParameters["Octopus.RunbookSnapshot.PreviousForEnvironment.Name"]
write-host "Octopus.Web.RunbookRunLink= " $OctopusParameters["Octopus.Web.RunbookRunLink"] 
write-host "Octopus.Web.RunbookSnapshotLink= " $OctopusParameters["Octopus.Web.RunbookSnapshotLink"] 
1 Like

Hi Fausto,
Thanks for reaching out regarding Runbooks. Sorry that you’re running into this issue with missing variables.

This is certainly a bug that was just fixed in version 2019.13.5. Take a look at Github Issue 6138 and let me know if you any concerns with the fix or upgrading to the latest LTS.

I hope this helps.

Kind Regards,
Tina

Great! Thank you for the information. We’ll upgrade soon.

1 Like