From 0f1b00401d17e936e80f16e02415c546f0c1d7ff Mon Sep 17 00:00:00 2001 From: Marcus Weiner Date: Fri, 12 Jul 2024 22:54:07 +0200 Subject: [PATCH] Fix usage of object_type on contact_assignment --- netbox/resource_netbox_contact_assignment.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netbox/resource_netbox_contact_assignment.go b/netbox/resource_netbox_contact_assignment.go index 768282ef..04faac5e 100644 --- a/netbox/resource_netbox_contact_assignment.go +++ b/netbox/resource_netbox_contact_assignment.go @@ -105,7 +105,11 @@ func resourceNetboxContactAssignmentRead(d *schema.ResourceData, m interface{}) return err } - d.Set("content_type", res.GetPayload().ContentType) + ct := res.GetPayload().ContentType + if ct == "" { + ct = res.GetPayload().ObjectType + } + d.Set("content_type", ct) if res.GetPayload().ObjectID != nil { d.Set("object_id", res.GetPayload().ObjectID)