Integration with hipchat

Issue

  • Jenkins notifications with Hipchat
  • Integrate Hipchat with Jenkins

Environment

  • Jenkins
  • Jenkins LTS
  • CloudBees Jenkins Enterprise
  • Hipchat

Resolution

A quick guide to setting up integration with Hipchat and Jenkins:

  1. First install the Hipchat plugin: Manage Jenkins > Manage Plugins > Available > and search for the Hipchat plugin.
  2. Restart the Jenkins instance.
  3. After restarting go to Manage Jenkins > Configure System
  4. Open another tab and navigate to your hipchat api url: www.hipchat.com/account/api.
  5. Generate a new API token with the following permissions: Send Notifications, View Rooms

api.png

Copy this API token. We will be using it (it will be referred to ask “API Token from step 5”).

  1. Navigate to https://hipchat.com/rooms and locate the room you would like to post messages to.
  2. Copy the API ID as this is the room id.
  3. Go back to Jenkins global configuration page, and paste the API Token from step 5, and the API ID from step 7:

jenkins_global_config.png

  1. Create a new Freestyle project.
  2. As part of the post-build actions drop down selection one should say “Hipchat notification”:

job_configuration.png

The Auth Token, and Project Room can be overridden from the system token.

  1. Click save and execute a build.
  2. Navigate to the room and you should see notifications from hipchat about the build completing:

hipchat_messages.png

Have more questions? Submit a request

3 Comments

  • 0
    Avatar
    Mark Stosberg

    The embedded article images on this page are all broken. 

  • 0
    Avatar
    Mark Stosberg

    It would be helpful to clarify whether a HipChat API v1 token is being used or Hipchat API v2 token. v1 API tokens are deprecated. 

  • 0
    Avatar
    Allan Burdajewicz

    Hello Mark,

    I have created a ticket internally to fix the images.

    The HipChat plugin integrates with both version. You can specify which version you want to use in the Global configuration. If you use Pipeline, you can also specify the version in the Jenkinsfile / pipeline script:

    hipchatSend(
      color: "RED",
      message: "${env.JOB_NAME} #${env.BUILD_NUMBER} failed! (<a href=\"${env.RUN_DISPLAY_URL}\">Open</a>)",
      notify: true,
      room: 'teama-room',
      credentialId: 'HipChat-API-Token-v2',
      v2enabled: true
    )

     

    If it didn't help you can request help on Users Mailing list or IRC. If you are a CloudBees customer feel free to raise a support ticket.

    Regards,

    Edited by Allan Burdajewicz
Please sign in to leave a comment.