telegram-notifications-plugin
telegram-notifications-plugin copied to clipboard
How to send notification in bot?
So I have such problem. I write my message without any command into field, and nothing happens inside console on postbuild steps. So, could you provide an example of filling this text box? Or method for checking of working bot.
@VladToporkov
I use such
post {
// only triggered when blue or green sign
success {
telegramSend "Pipeline $env.JOB_NAME #$env.BUILD_NUMBER $env.BUILD_URL"
}
// triggered when red sign
failure {
telegramSend "Pipeline $env.JOB_NAME #$env.BUILD_NUMBER - failed, please check $env.BUILD_URL"
}
}
I found this solution:
script{
withCredentials([string(credentialsId: ‘telegramToken’, variable: ‘TOKEN’),
string(credentialsId: ‘telegramChatId’, variable: ‘CHAT_ID’)]) {
telegramSend(messsage:”test message”,chatId:${CHAT_ID})
}
}
}