Capture deploy time value for later reporting

Hello,
We are trying to capture a deploy time value (an approval #) that we can use in future reports.

So far I have been able to add a “prompt” variable to capture some input during the deployment but Im wondering if there is a better way. I’ve also considered adding a manual step and leaning on the Notes for this input, but that is not much different than the prompt variable.

Since we are running Octopus on MSSQL2016 the query to grab the value later on is not too bad, but I would rather not have to query the db directly if there is a better way.

Thanks for any ideas!

query for ref:

  select json_value(d.value, '$.Value')
  from   [Octopus].[dbo].[VariableSet]
  cross
  apply	openjson(JSON, '$.Variables') d
  where  OwnerId = 'Deployments-12345' and
		  json_value(d.value, '$.Name') = 'ApprovalNumber'

Hi,

Thanks for reaching out! I think this PS script that hits the API should work: https://github.com/OctopusDeploy/OctopusDeploy-Api/blob/master/REST/PowerShell/Variables/GetVariableValueFromADeployment.ps1

Let me know if that’s what you are looking for.

Cheers,
Dalmiro

Nice, that looks interesting. Ill give it a try. Thanks!