telegram-notifications-plugin icon indicating copy to clipboard operation
telegram-notifications-plugin copied to clipboard

How to send notification in bot?

Open VladToporkov opened this issue 6 years ago • 2 comments

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 avatar Nov 26 '18 10:11 VladToporkov

@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"
        }
    }

romankydybets avatar Jan 28 '20 21:01 romankydybets

I found this solution:

 script{
  withCredentials([string(credentialsId: ‘telegramToken’, variable: ‘TOKEN’),
  string(credentialsId: ‘telegramChatId’, variable: ‘CHAT_ID’)]) {
  telegramSend(messsage:”test message”,chatId:${CHAT_ID})
  }
 }
}

fedor-git avatar Nov 21 '21 18:11 fedor-git