-
Notifications
You must be signed in to change notification settings - Fork 84
Telegram configuration
Vasenkov Stanislav edited this page Oct 3, 2022
·
10 revisions
To receive telegram bot notifications, you need to fill in the part of the configuration file referring to telegram
Configuration template for telegram bot notifications:
"telegram": {
"token": "...",
"chat": "...",
"replyTo": ""
}
- "token" - Token to access the HTTP API
- "chat" - Bot ID
- "replyTo" - Leave the field blank
Next, let's look at how to get this data
- Chat with @BotFather and he will give you a bot

- Remember the token you got from @BotFather

-
Add bot to your telegram chat (and make it admin)
-
Get telegram chat id, you can find it here -> https://api.telegram.org/botXXX:YYYYY/getUpdates (replace the XXX: YYYYY with your BOT HTTP API Token you just got from the Telegram BotFather)

The final configuration will look like this:
"telegram": {
"token": "7011306889:BBHJ9-NEi3KUYR2W-nzE2X7e1oMdHEdr9Jw",
"chat": "654789321",
"replyTo": ""
}
- Download latest release https://github.com/qa-guru/allure-notifications/releases
or build .jar
gradle jar
->build/libs/allure-notifications-*.jar
- Put allure-notifications-*.jar in your in your autotests project root
- Install Post build plugin https://plugins.jenkins.io/postbuild-task
- Run .jar in postbuild task, after allure-report is generated (!!!)

java \
"-Dchat.id=-1053872341..." \
"-Dbot.token=1265622901:AAHTwGNmvuqc..." \
"-Dproject.name=${JOB_BASE_NAME}" \ <- jenkins environment var
"-Dbuild.launch.name=Some release 2.0" \
"-Dbuild.env=https://prod.your.site" \
"-Dbuild.report.link=${BUILD_URL}" \ <- jenkins environment var
"-Dlang=en" \
"-Denable.chart=true" \
"-Dallure.report.folder=./allure-report/" \
-jar allure-notifications-2.2.1.jar
