Capture deploy time value for later reporting

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]
  apply	openjson(JSON, '$.Variables') d
  where  OwnerId = 'Deployments-12345' and
		  json_value(d.value, '$.Name') = 'ApprovalNumber'


Thanks for reaching out! I think this PS script that hits the API should work:

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


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