Search code examples
jenkinsgroovyslack

Jenkins / Slack : check if message has been send after using slackSend()


Hay,

I want to check if my Slack Message has been send to he chat. I can't find any kind of result of slackSend() which i can use for that.

I want to do sth like that in my Groovy Scipt:

result = slackSend(color: ..., message: ...)
if(result.hasSend()){
 //send sth in log
}

Thanks for your help.


Solution

  • In that case, just wrap the slackSend line in try catch, send success to logs in try after slackSend line and send failure to logs in catch block. – Rahul Sharma