Messenger integration

Messengers are a great way to quickly notify employees about important events. If a messenger has an API, you can use Tracker to set up a trigger that sends HTTP requests to the messenger's API during certain events. For instance, a request can be triggered once an error with the critical priority status is added to the queue.

Let's say we need to send an automatic notification to the messenger each time the issue status is changed. This could be used, for example, to track whether releases are ready for testing. To do this, we need to create a trigger that keeps track of issue statuses like “Release” and sends an HTTP request when the issue status changes to “Ready for testing”.

Let's look at how we can set up triggers that send notifications to Slack and Telegram.

  1. Slack
  2. Telegram

Slack

If you want Tracker notifications transmitted to team chats, set up the external app in Slack and create a trigger that will send messages to Slack via HTTP requests.

Step 1. Set up Slack
  1. Log in to Slack.

  2. Connect Tracker to Slack as an external app (Slack App):

    1. Follow the link Create your Slack app.

    2. Think of a name for the app, like “Tracker”.

    3. Select the workspace to connect Tracker to.

    4. Click Create App.

  3. Enable Incoming Webhooks → Activate Incoming Webhooks in the settings of your new Slack App.

  4. Refresh the settings page.

  5. Click Add New Webhook to Workspace.

  6. Select the channel Tracker will send messages to and click Authorize.

  7. The app settings page will then display the address Tracker will use to send messages in the Webhook URLs for Your Workspace section. Here's what the address should look like:

    https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

    Copy the address as you will need it when setting up Tracker integration.

Step 2. Set up Tracker
  1. Log in to Tracker. You must have administrator privileges for the queue you will be integrating.

  2. Go to queue settings, open the Triggers section, and click Create trigger.
  3. Enter the trigger name, such as “Slack notifications”.

  4. Configure trigger conditions so that the trigger reacts when the status of a Release issue changes to Ready for testing:
    1. Choose Conditions to meet → All.
    2. Add the condition Type → is equal to → Release.
    3. Add the condition Status → became equal to → Ready for testing.
  5. Click Add action and choose HTTP request.

  6. Configure the request:

    • Method: POST.

    • Address: The address you received when setting up integration in Slack.

    • Authorization method: NoAuth.

    • Content type: application/json.

    • Request body:

      {
        "link_names": true,
        "text": "@tracker, ready to test <https://tracker.yandex.ru/{{issue.key}}|{{issue.key}}>: {{issue.summary}}"
      }
    • Leave the headers empty.

  7. Save your trigger.

To test the trigger in action, change the issue status from Release to Ready for testing. The trigger sends a message to the group chat with the link to the issue and the following text: “Ready to test TEST-123: Trigger setup”.

Telegram

Telegram uses bots to automatically send messages to users or group chats. If you want Tracker notifications transmitted to Telegram, create a bot and set up a trigger that will send messages through the bot via HTTP requests.

Step 1. Setting up a Telegram bot
  1. Create a new Telegram bot:

    1. Add the @BotFather bot to contacts on Telegram and send it a message that says /start.

    2. Send a message that says /newbot and follow the instructions: come up with the bot's name for display (such as My Company) and an account name (such as MyCompanyBot). The account name must end with bot.

    You will then receive a message confirming the bot has been created successfully. The message will include a token, which a special code needed to access your bot via the API. The token follows the format of 1234567890:ABC123-defHIJ...

  2. 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, simply message the bot.

  3. Sending notifications to a Telegram chat requires a chat ID. You can view this ID by using a dedicated bot, such as @myidbot:

    • To find out the ID of a group chat, add the bot to said chat and send it a message that says /getgroupid. Please keep in mind that group chat IDs start with a minus -.
    • You can send private messages using your account ID. To do this, send the bot a private message that says /getid.

To learn more about setting up a Telegram bot, please go to https://core.telegram.org/bots.

Step 2. Set up Tracker
  1. Log in to Tracker. You must have administrator privileges for the queue you will be integrating.

  2. Go to queue settings, open the Triggers section, and click Create trigger.
  3. Enter the trigger name, such as “Telegram notifications”.

  4. Configure trigger conditions so that the trigger reacts when the status of a Release issue changes to Ready for testing:
    1. Choose Conditions to meet → All.
    2. Add the condition Type → is equal to → Release.
    3. Add the condition Status → became equal to → Ready for testing.
  5. Click Add action and choose HTTP request.

  6. Configure the request:

    • Method: POST.

    • Address: https://api.telegram.org/bot<token>/sendMessage

      Don't forget to insert the token value you received when setting up your Telegram bot into the address.

    • Authorization method: NoAuth.

    • Content type: application/json.

    • Request body:

      {
       "chat_id": "<chat ID>",
       "text": "Issue ready for testing [{{issue.key}}: {{issue.summary}}](https://tracker.yandex.ru/{{issue.key}})"
      }

      The value of the chat_id parameter must refer to the chat ID you received when setting up your Telegram bot.

    • 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.
  7. Save your trigger.

To test the trigger in action, change the issue status from Release to Ready for testing. The trigger will send a message to your Telegram chat that says: “Issue TEST-123 ready for testing: Configure triggers (https://tracker.yandex.ru/TEST-123)”.