0

我想以线程的形式向 Slack 发送 Jenkins 响应。可能吗..?

slackSend(频道:“构建”,消息:“开始构建”,thread_ts:如何?)

4

2 回答 2

2

根据本文,必须启用机器人用户模式。添加bot-user:true到 slacksend 命令将完成此操作,但随后我得到了一个管道步骤

于 2019-07-12T21:01:28.153 回答
1
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中找到

于 2019-01-18T11:17:26.237 回答