Added fallback behaviour for pkg category in Teams and Slack webhook delivery (fixes #111) #175
+6
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the Teams postprocessor, the package category is only passed into the embed via the
APP_CATEGORY
variable, which seems to need to be explicitly set, and doesn't appear to be the output of any of the other JamfUploader processors.This MR adds fallback behaviour where, if
APP_CATEGORY
is unset and ajamfpackageuploader_summary_result
is present, an attempt is made to extract the package category from thejamfpackageuploader_summary_result
. I have tested the JSON that the Teams postprocessor sends as a result of this change, and it now includes a category whenjamfpackageuploader_summary_result
contains one.I also went over the Slack postprocessor (as I originally based the Teams one off of it), and at least at a glance it looks like it suffers from the same issue. I included the same fix in this postprocessor as well.
This should fix #111.