Reference process step output from another deployment

Hi,

Is it possible to reference or retrieve (e.g. via the API) the output variables of another deployment? My use case is that I have a step to create a ServiceNow change request, outputting the CR#. As the release moves up the stack, it would be super if the same release deployed into lower environments can be captured as part of the change request in the higher environment.

Thanks

Hi @wsoo

You can use our variables REST endpoint to get a list of variables from a specific deployment. We have an example in our samples page regarding this, and this particular example retrieves a specific value. Using the deployment ID in here will allow you to get a full list, or select a particular one as shown in the example above.

Here is an example output of me grabbing a variable from a deployment where I set a “NewVariable” output variable in my first of two steps.

        {
            "Id": "70e68efc-c0f5-462e-8f4e-49e5924992a3",
            "Name": "Octopus.Action[Run a Script].Output.NewVariable",
            "Value": "new test",
            "Description": null,
            "Scope": {
                "User": [
                    "True"
                ]
            },
            "IsEditable": false,
            "Prompt": null,
            "Type": "String",
            "IsSensitive": false
        },

As you can see, it does prepend the “Octopus.Action… etc.” onto the start of the variable, but you should be able to perform a search once you get the data.

If you have anymore questions, please let me know!
Kind Regards
Sean

Hi Sean,

Thanks for that! Exactly what I needed.

Cheers,
Wei

1 Like