Classic Hangouts will be replaced by Google Chat. Learn about the switch from classic Hangouts to Google Chat.

Use the Jenkins bot

Use the Jenkins bot in Google Chat to get notifications about your Jenkins builds.

Before you begin

  • You need permission from your Google Workspace administrator to install bots.
  • You need to add the bot to Chat.
    Learn how to Find bots and add them to Chat.

Step 1: Install Chat plugin on Jenkins server

You must sign in as a Jenkins administrator to do this task.

  1. Download the Chat Notifier Plugin file.
  2. In Jenkins, go to Manage Jenkinsand thenManage Plugins.
  3. On the Advanced tab, under Upload Plugin, select the downloaded plug-in file from step 1 and click Upload.

People in your organization can now install and set up the Jenkins bot.

Step 2: Set up the Jenkins bot in Chat

Jenkins needs the token that the bot generates to send build notifications to Chat. Each space that you add the bot to gets a token. The bot sends notifications to all spaces where it's a member.

  1. Open Chat.
  2. Open a direct message with the bot or go to a space with the bot.
  3. Copy the token displayed by the bot.
  4. (Optional) To display the token again, choose an option:
    • In a direct message, enter token
    • In a space, enter @Jenkins token.
  5. (Optional) To regenerate the token, click Regenerate Token.

Step 3: Set up notifications

Get notifications for a build

  1. Open Jenkins.
  2. Go to the build that you want to add Chat notifications for.
  3. Under Build, next to Add build step, click the Down arrow "" and choose what to get notifications for, such as the build result.
  4. Under Post-build Actions, next to Add post-build actions, click the Down arrow "" and select Notify Hangouts Chat.
  5. Choose one of the following options and paste the token that you copied from Chat.
    • Chat—Choose a global configuration that you previously set up.
    • Chat Token—Override the global configuration for a specific Chat space.
  6. Check the boxes for the items that you want to get notifications about in Chat.
  7. Click Save.

You get notifications in Chat about build events, such as start, failure, and success. From a notification, you can click:

  • Open Build—Modify the build configuration in Jenkins.
  • View Details—View information about the notification.

Get notifications for a pipeline

  1. Open Jenkins.
  2. Open the pipeline that you want to add Chat notifications for.
  3. In your pipeline script, enter:

    hangoutsNotify message: "This message is from a pipeline!",token: "your_jenkins_token",threadByJob: false

    Note: In the above text, replace your_jenkins_token with the token that you copied above. You can set threadByJob to true or false.

  4. Click Save.

Using the bot in spaces

To use the bot in spaces, you need to explicitly @mention the bot in each message to the bot (including in replies to messages from the bot). The @mention confirms you're sending the message to the bot and not to others in the space.

Google, Google Workspace, and related marks and logos are trademarks of Google LLC. All other company and product names are trademarks of the companies with which they are associated.

Was this helpful?
How can we improve it?
Clear search
Close search
Google apps
Main menu
Search Help Center