Created
February 13, 2025 11:04
-
-
Save kibotu/3f5b4eb0bd8a070f9fbfa69150486896 to your computer and use it in GitHub Desktop.
Sending Slack Notifications from Jenkins to Threads + Reactions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def joke = new groovy.json.JsonSlurper().parseText(new URL("https://icanhazdadjoke.com/slack").text).attachments.text.join('') | |
def slackResponse = slackSend( | |
channel: "slack-tests", | |
color: "danger", | |
message: "$joke" | |
) | |
slackResponse.addReaction("thumbsup") | |
slackSend( | |
channel: slackResponse.threadId, | |
color: "good", | |
message: "Hihi :face_with_hand_over_mouth:" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment