ALL BLOGS

How to Migrate Jenkins Notifications from Office 365 Connector to Power Automate for Microsoft Teams

Introduction: Why This Migration Matters

As CI/CD pipelines grow more critical to engineering velocity, staying informed in real-time becomes essential. At ITR VN, we rely on seamless notifications between Jenkins and Microsoft Teams to track deployments and resolve issues quickly. With Microsoft phasing out the Office 365 Connector, many teams face disruption. Here's how we transitioned smoothly using Power Automate—without changing a single Jenkins job.

The Compatibility Challenge with Power Automate

One key considerationis that the Jenkins plugin still sends messages in Actionable Message Card format, which Power Automate does not support (more info). To address this, we will convert the notification content into Adaptive Cards before sending it to Teams.

Migration Objective: Keep Jenkins Pipelines Untouched

Our goal is to maintain the existing notification flow without modifying the Jenkins pipeline, ensuring a smooth transition. Next, we’ll set up a Power Automate workflow to handle this update

Step 1: Understand Your Current Jenkins Payload

Before setting up Power Automate, ensure the following:

- Update the Jenkins Office 365 Connector plugin to version 5.x

- Review the notification payload format sent by the plugin.

- The existing payload is as following: Success:

  • Failed:

Step 2: Create Power Automate Workflow for the Notifications

Now, it’s time to create the Power Automate workflow to handle the notifications. Follow these steps:

1. From MS Teams, create a new Workflow from the left-hand menu.

2. Select the template: Post to a channel when a webhook request is received

3. Set the channel and webhook URL:

- Choose the Teams channel where you want to send the notifications.

- Copy the webhook URL generated by Power Automate. You’ll need to configure Jenkins to send notifications to this URL.

Step 3: Configure the Workflow

With the Power Automate workflow created, we now need to customize it to process Jenkins notifications correctly and format them as Adaptive Cards. You should go to the Power Automate web app to make the changes, instead of on MS Teams app. From the left-hand menu, choose My flows, then edit your flow

1. Edit the workflow structure: Open the Power Automate workflow and update its structure like beblow

2. Configure the Parse JSON action:

Insert expression with value: first(triggerBody()['sections'])

And schema:

3. Configure the Select action:  

Select Enter the data from previous step, then choose Body facts

Input Map value:

- title with expression value: concat(item()?['name'], ':')

- value with Previous step data: Body value  

4. Configure the Initialize variable action

5. Configure the Condition: If the triggerBody().themeColor is not “#00FF00”, set variable styleColor to attention

6. Configure the Post card in a chat or channel action: modify the Adaptive card with the below content

- Once configured, this workflow will ready for the Jenkins notifications.

Conclusion

By transitioning from the deprecated Office 365 Connector to Power Automate, we successfully kept Jenkins notifications in Microsoft Teams without modifying our Jenkins pipelines.

With this setup:

  • Jenkins continues sending notifications as before.
  • Power Automate receives and processes the messages, converting them from the legacy Actionable Message Card format to Adaptive Cards.
  • Teams displays notifications correctly, ensuring our team stays informed about build statuses.

You can also customize the Adaptive Card to match your style. Microsoft provides a design tool here: Adaptive Card Designer.

ITR – A trusted tech hub in MedTech and Digital Health
Tag name
Tag name
No results.
Thank you!
Your submission has been received.
Something went wrong while submitting the form. Please try again.

Build Impactful Products
Faster than Competitors

By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.