我想将Jenkins响应作为线程发送给Slack。有可能..?
slackSend(频道:“构建”,消息:“开始构建”,thread_ts:如何?)
答案 0 :(得分:0)
node {
def slackResponse = slackSend(channel: "cool-threads", message: "Here is the primary message")
slackSend(channel: slackResponse.threadId, message: "Thread reply #1")
slackSend(channel: slackResponse.threadId, message: "Thread reply #2")
}
回复广播到频道消息
node {
def slackResponse = slackSend(channel: "ci", message: "Started build")
slackSend(channel: slackResponse.threadId, message: "Build still in progress")
slackSend(
channel: slackResponse.threadId,
replyBroadcast: true,
message: "Build failed. Broadcast to channel for better visibility."
)
}
更多信息可以在官方文档中找到 https://github.com/jenkinsci/slack-plugin
答案 1 :(得分:0)
根据this文章,必须启用漫游器用户模式。将bot-user:true
添加到slacksend命令将完成此操作,但是随后我得到了一个流水线步骤