Notify your MS Teams channel on Jenkins Job failure

Jenkins is dead … Long live concourse | by Ricardo Espírito Santo ...
Microsoft Teams Without the Teams - Karin Skapski

With now more people working from home and using more messaging tools like MS Teams, I thought it would be a good idea to drop couple of lines on how you can alert your MS Teams channel from your Jenkins pipeline and get notified on your Laptop or Phone on any failures.

Following steps guide you on how to integrate Jenkins with Microsoft Teams and get notified.

First you would need to create your MS Team channels and then add a webhook to it. Once you click on your connector, the you can select an “incoming Webhook“.

Clicking on Configure will give you an option to upload an image, give it a name and finally create the webhook

After creating it , it will provide you with an unique string which you would need in the next step for configuring Jenkins.

Now that you have created your Webhook , you would need to open Jenkins and navigate to “Manage Jenkins

Select “Manage Plugins” and under “available” tab search for “Office 365 connector” and install the plugin.

Under your project , select “Configure” and select the “Office 365 connector” tab.

Copy/paste the Webhook url from previous step and the name and click on “Add Webhook“.

Under the advance section , you can specify for which scariness you want to get notified, in the example below, I wanted to be alerted when the build fails, succeeds, is unstable , and when it is back to normal.

Now hit the save button and you are done.

From now on, once your build runs , if it hits any of the conditions above you(and your team) would get notified your channel.

<Happy Testing >

Leave a comment