Passing values between task running of Deployment Target to task running on Octopus Server

Hi There,

I have a project which I have tasks running on the individual deployment targets that are deploying and collecting information, that I would like to be able to use in tasks that are running on the server.

The reason being is that I have Jira integration that is only allowed to run from the Octopus server (due to firewall restrictions), but basically I am wanting to include status information from the tasks that are running on the deployment targets. Is there a way I can write back to an Octopus variable or something like that to be able to pass through values back to the Octopus Server to be used in Octopus Server task?

Really looking forward to your thoughts?

Thanks,
Damien

Hey @damien_taylor

Thanks for getting in touch with Octopus!

That’s a great question, and one we get quite frequently.

I think from what you’ve described, output variables could be suitable for your scenario, in particular, the section regarding output from multiple machines.

The tl;dr is that you can set variable values on one deployment target step to be used in subsequent steps. It supports sensitive values too, so you can have values stored safely if they are to be kept protected from prying eyes!

To set a variable in a script step named StepA, run something like this:

Set-OctopusVariable -name "TestResult" -value "Passed"

Then to use that variable value of Passed in another step:

$TestResult  = $OctopusParameters["Octopus.Action[StepA].Output.TestResult"]
Write-Host "Test Result: $TestResult"

I hope that helps, but let me know if you have any further questions!

Best regards,
Mark

Thanks Mark! This is exactly what I needed and works perfectly. thanks!

1 Like

Awesome! Thanks for letting me know :slight_smile: