• Home
  • Posts
  • About Me
  • RSS
Notify changelog to Teams using Jenkins
So we can back to focus on solving problems
Jun 14, 2025 | 3 mins read
jenkins groovy tutorial

Suppose we want to start documenting the changelog, so we can easily track what new features, improvements, bugfixes are delivered in each version. To do that, we need to list the tickets done on every release version.

For this article, we want the changelog note to contain: service name, version, and list of tickets done.

Amazing Service 1.2.0

Features

  • PROJECT-1232
  • PROJECT-1231

Techdebt

  • PROJECT-1241 - improve query performance

Bugfix

  • PROJECT-1252 - fix intermittent error
  • PROJECT-1251

Other

  • PROJECT-1301

Imagine the manual work needed to do this:

  1. list the branches/tickets being merged to current release
  2. write the changelog
  3. post to Ms Teams channel

It must be done for every release version. Even doing it for a single service is already a chore. More so if you need to do it for many services, it’ll be hell. Our time will just be spent for administrative task instead of pushing our iterations quicker.

If you’re facing the same problem and already using Jenkins and Ms Teams, then this post may be for you.

Prerequisites

  1. Using Jenkins with Office365 Connector and this pipeline library:
    https://github.com/griddynamics/mpl#use-standard-pipeline-but-with-custom-module
  2. Using Ms Teams channel to post the releases
  3. Already use git tag to annotate each release
  4. Using maven release plugin and maven deploy

How to

Suppose we have this kind of merge commits between version 1.1.0 and 1.2.0:

  • Merge feature/PROJECT-1232 to release/1.2
  • Merge techdebt/PROJECT-1241-improve-query-performance to release/1.2
  • Merge feature/PROJECT-1231 to release/1.2
  • Merge bugfix/PROJECT-1252-fix-intermittent-error to release/1.2
  • Merge bugfix/PROJECT-1251 to release/1.2
  • Merge PROJECT-1301 to release/1.2

In general, we need to:

  1. Create a project-specific configuration in Jenkinsfile
  2. Create a step file: {ProjectRepo}/.jenkins/modules/{Stage}/{Name}{Stage}.groovy (name could be empty)
  3. Fill the step with our changelog notification code: we can use CFG config object & MPL functions inside the steps definition

For this case, we will use “Deploy” step with path .jenkins/modules/Deploy/Deploy.groovy.

We can check other standard steps on Jenkins Modular Pipeline Library repo: https://github.com/griddynamics/mpl/tree/master/resources/com/griddynamics/devops/mpl/modules

1. Configure some project-specific settings

  • ticketingUrl is, like the name suggests, the base URL of your ticketing system or issue tracker e.g. Github Issues, Jira, etc.
  • teamsWebhookUrl is the webhook URL of your teams channel which will be notified with changelog posts.

2. Create the step file

Path: .jenkins/modules/Deploy/Deploy.groovy

We want to make sure the changelog is only posted to Teams on a successful release, and not during snapshot. That means we need to execute extra logic after the original “Deploy” step. Assuming params.RELEASE_TYPE will have value RELEASE on a release build, then:

3. Generate changelog & send notification to Teams

Next, we extract branch names from merge commits between previous tag and latest commit for further processing.

branches value would be something like:

We then group branches by their type (feature, techdebt, bugfix, etc).

groupedBranches value would be something like:

Next is generating the markdown for the body of the Teams post. We simply list the ticket number and the description under each type.

Then the generated markdown would be something like:

Finally, post using office365 connector:

Result

For example above, once the release build is finished and deployed, Jenkins will automatically notify the changelog to the Ms Teams channel.

Amazing Service 1.2.0

Feature

  1. PROJECT-1232
  2. PROJECT-1231

Techdebt

  1. PROJECT-1241 - improve query performance

Bugfix

  1. PROJECT-1252 - fix intermittent error
  2. PROJECT-1251

Etc

  1. PROJECT-1301

This article show and example to generate a changelog and send it to a Teams channel. Using a similar method, we can send the changelog to almost anywhere with a HTTP API easily using curl or supported plugins.

That’s all Folks!

References

  • https://github.com/griddynamics/mpl
  • https://plugins.jenkins.io/Office-365-Connector/
  • https://www.jenkins.io/doc/pipeline/steps/Office-365-Connector/
jenkins groovy tutorial
‹ Previous
Why and How You Do Query Routing With Spring R2DBC

Copyright © 2025 Ray Naldo