I’m trying to set up my Jenkins server to send me Telegram messages whenever a new build starts. I’ve been messing around with the Telegram Notification Plugin for Jenkins, but I can’t seem to get it working right.
Has anyone here successfully set up Telegram notifications from Jenkins? If so, could you share some tips or steps you followed? I’m open to other methods too if there’s a better way to do this.
I’ve implemented Telegram notifications for Jenkins builds in my company, and it’s been a game-changer for our team. Here’s what worked for us:
We used the Telegram Bot API instead of relying entirely on the plugin because it offers more flexibility and reliability. We created a dedicated bot for Jenkins notifications using BotFather on Telegram, and then wrote a simple shell script to send messages through the bot API. Our Jenkins pipeline calls this script, and we secured our setup by adding environment variables for the bot token and chat ID. Finally, we customized the message format to include the build number, status, and a link to the build page. Although the setup took some trial and error, it significantly improved our response time to build failures. If more specifics are needed, I’m open to sharing the script template.
yo, got it working with a simple bash script. made a bot via @BotFather, grabbed token, and hit the telegram API from jenkins pipeline. now it sends msgs on build changes. works like a charm! hit me up for more info.
I’ve had success integrating Telegram notifications with Jenkins using a different approach. Instead of the Telegram Notification Plugin, we leveraged Jenkins’ HTTP Request plugin along with Telegram’s Bot API. This method proved more reliable and customizable for our needs.
First, we created a Telegram bot using BotFather and obtained the API token. Then, we set up a Jenkins pipeline stage that sends a POST request to Telegram’s API endpoint whenever a build event occurs. We stored sensitive information like the bot token and chat ID as Jenkins credentials for security.
The HTTP Request plugin allows us to format the message payload exactly as we want, including build status, commit details, and direct links to the Jenkins console. This setup has been running smoothly for months now, providing instant updates to our team without any missed notifications.