From b5cfa0fc1a715dae72fc042400d62e28664505d4 Mon Sep 17 00:00:00 2001 From: Tal Borenstein Date: Mon, 18 Nov 2024 17:31:55 +0200 Subject: [PATCH 1/2] fix(ui): styling in alert table when empty --- keep-ui/app/alerts/alerts-table-body.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keep-ui/app/alerts/alerts-table-body.tsx b/keep-ui/app/alerts/alerts-table-body.tsx index 771d2e8f7..d460cf79c 100644 --- a/keep-ui/app/alerts/alerts-table-body.tsx +++ b/keep-ui/app/alerts/alerts-table-body.tsx @@ -35,7 +35,7 @@ export function AlertsTableBody({ if (showEmptyState) { return ( <> -
+
Date: Mon, 18 Nov 2024 18:04:18 +0200 Subject: [PATCH 2/2] fix: enhance sn --- .../servicenow_provider/servicenow_provider.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/keep/providers/servicenow_provider/servicenow_provider.py b/keep/providers/servicenow_provider/servicenow_provider.py index f1afd1776..307dea496 100644 --- a/keep/providers/servicenow_provider/servicenow_provider.py +++ b/keep/providers/servicenow_provider/servicenow_provider.py @@ -188,8 +188,9 @@ def validate_config(self): def _query( self, table_name: str, - get_incidents: bool = False, incident_id: str = None, + sysparm_limit: int = 100, + sysparm_offset: int = 0, **kwargs: dict, ): request_url = f"{self.authentication_config.service_now_base_url}/api/now/table/{table_name}" @@ -205,11 +206,23 @@ def _query( if self._access_token: headers["Authorization"] = f"Bearer {self._access_token}" + if incident_id: + request_url = f"{request_url}/{incident_id}" + + params = {"sysparm_offset": 0, "sysparm_limit": 100} + # Add pagination parameters if not already set + if sysparm_limit: + params["sysparm_limit"] = ( + sysparm_limit # Limit number of records per request + ) + if sysparm_offset: + params["sysparm_offset"] = 0 # Start from beginning + response = requests.get( request_url, headers=headers, auth=auth, - params=kwargs, + params=params, verify=False, timeout=10, )