Use the Jenkins bot

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

Before you begin

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 room that you add the bot to gets a token. The bot sends notifications to all rooms where it's a member.

  1. Open Chat.
  2. Open a direct message with the bot or go to a room 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 room, 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 room.
  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 rooms

To use the bot in rooms, 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 room.


Google, G Suite, 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?