From 38ec3bc43295435052fec54504f16505c5c0ea2b Mon Sep 17 00:00:00 2001 From: maldotcom2 <149653530+maldotcom2@users.noreply.github.com> Date: Tue, 28 Oct 2025 08:09:21 +1100 Subject: [PATCH] Fix do nothing erroneous api call for Pagerduty (#6231) Co-authored-by: Frank Elsinga --- server/notification-providers/pagerduty.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/notification-providers/pagerduty.js b/server/notification-providers/pagerduty.js index c60d782e7..385ad2af0 100644 --- a/server/notification-providers/pagerduty.js +++ b/server/notification-providers/pagerduty.js @@ -23,9 +23,7 @@ class PagerDuty extends NotificationProvider { if (heartbeatJSON.status === UP) { const title = "Uptime Kuma Monitor ✅ Up"; - const eventAction = notification.pagerdutyAutoResolve || null; - - return this.postNotification(notification, title, heartbeatJSON.msg, monitorJSON, eventAction); + return this.postNotification(notification, title, heartbeatJSON.msg, monitorJSON, "resolve"); } if (heartbeatJSON.status === DOWN) { @@ -63,10 +61,6 @@ class PagerDuty extends NotificationProvider { */ async postNotification(notification, title, body, monitorInfo, eventAction = "trigger") { - if (eventAction == null) { - return "No action required"; - } - let monitorUrl; if (monitorInfo.type === "port") { monitorUrl = monitorInfo.hostname; @@ -79,6 +73,13 @@ class PagerDuty extends NotificationProvider { monitorUrl = monitorInfo.url; } + if (eventAction === "resolve") { + if (notification.pagerdutyAutoResolve === "0") { + return "no action required"; + } + eventAction = notification.pagerdutyAutoResolve; + } + const options = { method: "POST", url: notification.pagerdutyIntegrationUrl,