Skip to content

Instantly share code, notes, and snippets.

@kibotu
Created February 13, 2025 11:04
Show Gist options
  • Save kibotu/3f5b4eb0bd8a070f9fbfa69150486896 to your computer and use it in GitHub Desktop.
Save kibotu/3f5b4eb0bd8a070f9fbfa69150486896 to your computer and use it in GitHub Desktop.
Sending Slack Notifications from Jenkins to Threads + Reactions
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