From 466b07f1ff09e30b7f1c4c3e6750275b8100e035 Mon Sep 17 00:00:00 2001 From: Michael Milaitis Date: Tue, 17 Dec 2024 08:13:58 +0200 Subject: [PATCH 1/2] Fixes issue #634 --- changes/634.fixed | 4 ++++ .../integrations/servicenow/diffsync/adapter_nautobot.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/634.fixed diff --git a/changes/634.fixed b/changes/634.fixed new file mode 100644 index 00000000..d7e3d612 --- /dev/null +++ b/changes/634.fixed @@ -0,0 +1,4 @@ +ServiceNow Integration +When running the Nautobot ⟹ ServiceNow job with a site filter set, you expect the job to sync only the specified locations to ServiceNow. +However, it appears that the job currently loads only the parent locations, not the specified location itself. +This is fixed by initializing the locations list with the user-selected location and then loading the parent locations of that selection. diff --git a/nautobot_ssot/integrations/servicenow/diffsync/adapter_nautobot.py b/nautobot_ssot/integrations/servicenow/diffsync/adapter_nautobot.py index c2bc4680..f6b95606 100644 --- a/nautobot_ssot/integrations/servicenow/diffsync/adapter_nautobot.py +++ b/nautobot_ssot/integrations/servicenow/diffsync/adapter_nautobot.py @@ -59,7 +59,7 @@ def load_locations(self): """Load Nautobot Location objects as DiffSync Location models.""" if self.site_filter is not None: # Load only direct ancestors of the given Site - locations = [] + locations = [self.site_filter] ancestor = self.site_filter.parent while ancestor is not None: locations.insert(0, ancestor) From 187dd48be619e2094e60ab610b56c33ab0f6c887 Mon Sep 17 00:00:00 2001 From: michalis1 Date: Thu, 19 Dec 2024 08:07:51 +0200 Subject: [PATCH 2/2] fix documentation --- changes/634.fixed | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/changes/634.fixed b/changes/634.fixed index d7e3d612..363c0cd7 100644 --- a/changes/634.fixed +++ b/changes/634.fixed @@ -1,4 +1 @@ -ServiceNow Integration -When running the Nautobot ⟹ ServiceNow job with a site filter set, you expect the job to sync only the specified locations to ServiceNow. -However, it appears that the job currently loads only the parent locations, not the specified location itself. -This is fixed by initializing the locations list with the user-selected location and then loading the parent locations of that selection. +Fixed load locations on the source adapter for the ServiceNow integration when a site filter is applied. \ No newline at end of file