From 10816a080302eb70ba6b7d826ffc7ec9bab33408 Mon Sep 17 00:00:00 2001 From: "veo.chen" Date: Wed, 11 Oct 2023 15:03:00 +1300 Subject: [PATCH] comment --- octopusdeploy/schema_deployment_action.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/octopusdeploy/schema_deployment_action.go b/octopusdeploy/schema_deployment_action.go index 81037ee46..62ff296c4 100644 --- a/octopusdeploy/schema_deployment_action.go +++ b/octopusdeploy/schema_deployment_action.go @@ -386,15 +386,16 @@ func expandAction(flattenedAction map[string]interface{}) *deployments.Deploymen action := deployments.NewDeploymentAction(name, actionType) + // Retain the existing id as older channel rules might still be referencing the action by id + if v, ok := flattenedAction["id"]; ok { + action.ID = v.(string) + } + // expand properties first if v, ok := flattenedAction["properties"]; ok { action.Properties = expandProperties(v) } - if v, ok := flattenedAction["id"]; ok { - action.ID = v.(string) - } - if v, ok := flattenedAction["can_be_used_for_project_versioning"]; ok { action.CanBeUsedForProjectVersioning = v.(bool) }