From bb91cfd151ad76d5d4d59ca96c6b045f4beb190b Mon Sep 17 00:00:00 2001 From: jc0b Date: Mon, 21 Oct 2024 21:06:49 +0200 Subject: [PATCH] Added fallback behaviour for pkg category in Teams and Slack webhook delivery (fixes #111) --- JamfUploaderProcessors/JamfUploaderSlacker.py | 3 +++ JamfUploaderProcessors/JamfUploaderTeamsNotifier.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/JamfUploaderProcessors/JamfUploaderSlacker.py b/JamfUploaderProcessors/JamfUploaderSlacker.py index 94bf5b7..37455f7 100644 --- a/JamfUploaderProcessors/JamfUploaderSlacker.py +++ b/JamfUploaderProcessors/JamfUploaderSlacker.py @@ -125,6 +125,9 @@ def main(self): slack_channel = self.env.get("slack_channel") or "" slack_icon_emoji = self.env.get("slack_icon_emoji") or "" + if (not category and jamfpackageuploader_summary_result): + category = jamfpackageuploader_summary_result["data"]["category"] + selfservice_policy_name = name self.output(f"JSS address: {jss_url}") self.output(f"Title: {selfservice_policy_name}") diff --git a/JamfUploaderProcessors/JamfUploaderTeamsNotifier.py b/JamfUploaderProcessors/JamfUploaderTeamsNotifier.py index 14397ef..ca39460 100644 --- a/JamfUploaderProcessors/JamfUploaderTeamsNotifier.py +++ b/JamfUploaderProcessors/JamfUploaderTeamsNotifier.py @@ -111,6 +111,9 @@ def main(self): "jamfpolicyuploader_summary_result" ) + if (not category and jamfpackageuploader_summary_result): + category = jamfpackageuploader_summary_result["data"]["category"] + teams_webhook_url = self.env.get("teams_webhook_url") teams_username = self.env.get("teams_username") teams_icon_url = (