Skip to content

Commit

Permalink
Align Slack notifications for Jenkins app and webhook (#98)
Browse files Browse the repository at this point in the history
The notification format when using the SlackJenkinsAppNotifyTarget class differs from the SlackWebHookNotifyTarget format. This commit aligns the two message formats to be the same and fixes a slight malformatting issue present only in SlackJenkinsAppNotifyTarget which mangles URLs at the end of the message.
  • Loading branch information
jordanjennings authored Sep 25, 2023
1 parent 236c42a commit 1b6afd2
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ class SlackJenkinsAppNotifyTarget extends BaseConfig<SlackJenkinsAppNotifyTarget
color = "#36a64f"
break
}
message = "*${URLDecoder.decode(Config.pipeline.env.JOB_NAME, "UTF-8")}* (<${Config.pipeline.env.BUILD_URL}|build #${Config.pipeline.env.BUILD_NUMBER}>)\n" + message
def slackSendOptions = [
color : color,
message: message,
message: "*${URLDecoder.decode(Config.pipeline.env.JOB_NAME, "UTF-8")}* (<${Config.pipeline.env.BUILD_URL}|build #${Config.pipeline.env.BUILD_NUMBER}>)",
attachments: [
[
color: color,
text : message,
]
]
]
if (channel) {
slackSendOptions["channel"] = channel
Expand Down

0 comments on commit 1b6afd2

Please sign in to comment.