Telegram
Let's assume that you need to automatically send notifications to the messenger whenever an issue changes its status. You may need it to see when your releases are ready for testing. To do this, create a trigger that monitors the statuses of issues of the Issue type and sends an HTTP request when the issue status changes to Need info.
The Telegram messenger uses bots to automatically send messages to group chats and individual users. If you want to transmit Tracker notifications to Telegram, create a Telegram bot and set up a trigger that will send messages through the bot via HTTP requests.
Step 1. Setting up a Telegram bot
-
Create a new Telegram bot:
-
Add the
@BotFather
bot to your contacts in Telegram and send it a message saying/start
. -
Send the message
/newbot
and follow the instructions: make up a display name for the bot (e.g.,My Company
) and an account name (e.g.,MyCompanyBot
). The account name must end withbot
.
In response, you will get a message that the bot has been created successfully. The message will include the token: a secret code that you will need to access your bot over the API. The token follows the
1234567890:ABC123-defHIJ...
format. -
-
Add the bot you created to the Telegram group chat you want to send Tracker notifications to.
If you want to receive Tracker notifications privately, start a chat with the bot. -
Find out the ID of the Telegram chat where you want to post notifications. You can view this ID by using a dedicated bot, e.g.,
@myidbot
:- To find out the ID of a group chat, add the bot to this chat and send it a message saying
/getgroupid
. Please keep in mind that group chat IDs start with a minus sign-
. - You can send private messages using your account ID. To do this, send the bot a private message saying
/getid
.
- To find out the ID of a group chat, add the bot to this chat and send it a message saying
To learn more about setting up a Telegram bot, please visit https://core.telegram.org/bots
Step 2. Set up Tracker
-
Log in to Tracker. You must have administrator privileges for the queue for which you want to configure the trigger.
-
In the left panel, click
Queues and select a queue. -
In the top-right corner, click
Queue settings. -
On the left-hand panel, select Automation → Triggers and click Create trigger.
-
Name the trigger, e.g., Telegram notifications.
-
Configure trigger conditions so that the trigger is fired when the status of an issue of the Issue type changes to Need info:
-
Select Conditions to be met → All.
-
Add the condition: Type → is equal to → Issue.
-
Add the condition: Status → became equal to → Need info.
-
-
Click Add new action and choose HTTP request.
-
Set up the request:
- Method: POST.
- Address:
https://api.telegram.org/bot<token>/sendMessage
.
Where<token>
is the value of the token you got when setting up the Telegram bot. - Authorization method: NoAuth.
- Content type: application/json.
- Request body:
{ "chat_id": "<chat_ID>", "text": "Need info for issue [{{issue.key}}: {{issue.summary}}](https://tracker.yandex.com/{{issue.key}})" }
<chat_ID>
is the chat ID you obtained when setting up the Telegram bot.
To add the issue field values to the request body, click { } to the right of the field and choose the field name. - Leave the headers empty.
Note
If you want to use other methods and parameters in your HTTP requests, please refer to the Telegram bot API guide at https://core.telegram.org/bots/api
. -
Save your trigger.
To test the trigger in action, change the status of an issue of the Issue type to Need info. The trigger will send a message to your Telegram chat saying: Need info for issue TEST-123: Configure triggers