March 1, 2021

How to connect Discord and Plastic SCM

Do you want to receive Discord notifications from Plastic SCM like the one below?

Follow me; it's easy!

Discord Webhook

First, you need to find the Discord channel where you want to receive the notifications:

  1. Open the Discord channel preferences and click "Integrations".
  2. Enter the "Webhooks" area to create a new one.
  3. Copy the webhook URL because you will need it for the Plastic SCM Webtrigger.

Plastic SCM WebTrigger

Now, you have to choose the Plastic SCM action you want to send to Discord. Check the Plastic SCM triggers guide to get a complete list of operations you can notify. I decided to use after-mkbranch and after-ci, so I'll receive notifications when someone creates a new branch or runs a checkin operation. And this is how I create the trigger using the command line:

> cm tr mk after-ci NotifyTeam-Ci "webtrigger https://discord.com/api/webhooks/810908382236114944/1ibzJPH4lm13dx9-95f5dY5UP8KsgQRw4yXKu71Gj0oIflEmosidoO9714enganado01ULCvA" --server=localhost:8787
> cm tr mk after-mkbranch NotifyTeam-Branch "webtrigger https://discord.com/api/webhooks/810908382236114944/1ibzJPH4lm13dx9-95f5dY5UP8KsgQRw4yXKu71Gj0oIflEmosidoO9714enganado01ULCvA" --server=localhost:8787

To test the notifications, you need to run the Plastic SCM operation you chose while creating the Plastic SCM Webtriggers. In my case, if I make a new branch, I get this notification:

And every time there's a checkin operation at the repository, I get this other message:

Availability

You can start using this new feature with the 9.0.16.5128 Plastic SCM release (and higher).

No comments:

Post a Comment