Want to update variable values as #{env}.#{site} in variable set

I want to update variable values as #{env}.#{site} using octopus Api.
but when trying to do update the values its resolving the env and site tokens since these are octopus inbuilt tokens , could you please help me how can I achieve this .

Hi @YuvarajDuraisamy,

Thanks for getting in touch! We have a sample script available in our docs linked below that I was able to confirm updated a project variable’s value to “#{env}.#{site}” instead of attempting to evaluate each of those individual variables.

https://octopus.com/docs/octopus-rest-api/examples/variables/add-update-project-variable

However running this same script during a deployment will attempt to evaluate each of these variables. Is this the method you’re using to run the API script, e.g. during a deployment? If so, I can try to think of a decent way to approach preserving this value and avoid substitution during the deployment.

Best regards,

Kenny

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.