Thanks for reaching out! I’m sorry you are having trouble with this particular output variable feeding into your email subject line, but I would be happy to help take a closer look at this. In reviewing the information you’ve provided so far it does look like your syntax is correct, so we’ll need to dive a little deeper on this.
As a first step, would you be able to enable verbose variable output for this project and run through another deployment to see what all gets outputted? Enabling these variables within your project will force Octopus to print all relevant variables in the deployment task log. Feel free to upload the new task log at the following secure link for review if you’d like our team to take look.
I hope this helps shed some light on the underlying problem, but let me know if I can be of any more help.
Searched for targets:
August 18th 2022 14:59:18Verbose
* specifically matching these ids: Machines-101
* that are enabled
* with no id exclusions
* with no environment exclusions
* has a role that overlaps: WWW App
* with no tenant exclusions
* with any health status
August 18th 2022 14:59:18Info
Skipping this step as no matching targets were found
Thanks for providing more detail around your process.
Unfortunately, as this deals with step output variables you would need to run through a deployment to test this properly. This is also why you are unable to pre-select the variable via drop-downs, as this output variable is generated dynamically during the deployment process.
A couple of things you could try to speed up the debugging process would be to break these specific steps out into their own project/runbook temporarily (using the "Run a Script step template) so you can isolate the problem, or alternatively you could redeploy your existing project and exclude any steps that are not relevant to your current testing.
So I thought perhaps it’s empty because I hadn’t set a Package Id, but then when i set package Id,
I get an error
[Octopus Deploy] Creating release...
[04:50:54] [Octopus Deploy] Error from Octopus server (HTTP 400): There was a problem with your request.
[04:50:54] [Octopus Deploy]
[04:50:54] [Octopus Deploy] - No package version was specified for Extract Build Info:XXX.CorporateSite.Web.Site
[04:50:54] [Octopus Deploy]
Well of course i didn’t specify a version in that step, it doesn’t give me an option to do so… Nor would i want to i just want it to grab the Build info the package currently being deployed.
You can access the build information by calling against /space-id/build-information. You can view the calls you can perform by accessing the SwaggerUI on your URL (which is your base URL and swaggerui/index.html just in case you haven’t accessed it before).
You can get build information by a list or ID, and then on each build information object, you will have a branch property.