Integrating JIRA with HipChat

HipChat is a group chat, an IM service from Atlassian. It provides features such as persistent chat rooms and drag-and-drop file sharing, with support for web, desktop, and mobile.

In this recipe, we will integrate JIRA with HipChat, so every time an issue is created in the Support project, a notification will be sent to the corresponding HipChat room.

Getting ready

Since we will be using HipChat in this recipe, you will need to have a HipChat account. If you do not have one, you can sign up for a free account at https://www.hipchat.org.

The integration requires the HipChat for JIRA add-on, which is bundled with JIRA by default. However, if you do not have the add-on installed for some reason, you can get it from the following link:

https://marketplace.atlassian.com/plugins/com.atlassian.labs.hipchat.hipchat-for-jira-plugin

How to do it…

Proceed with the following steps to integrate JIRA with HipChat:

  1. The first step is to create a new API token in HipChat for JIRA:
    1. Log in to your HipChat account; you need to have admin-level access.
    2. Navigate to Group Admin | API.
    3. Select Admin for Type and enter a label. The label should indicate the system that will be using the token, for example, JIRA.
    4. Click on Create to create the new API token:
    How to do it…
  2. Now that we have created a new API token, we can use it to enable integration between JIRA and HipChat:
    1. Navigate to Administration | System | HipChat Configuration.
    2. Cut and paste the API token from HipChat into the Admin Token field and click on Save.
  3. The last step is to update our workflow so that JIRA will send out notifications when an issue is transitioned; this is done as follows:
    1. Navigate to Administration | Issues | Workflows.
    2. Click on the Edit link for the workflow that is used by our project.
    3. Locate the Create Issue transition and click on Post functions.
    4. Click on the Add post function link and select Notify hipchat.
    5. Enter the JQL query if you want to filter and limit the issues that will send notifications to HipChat; leave it blank for all issues.
    6. Select the chat room(s) that the notifications should be sent to.
    7. Select whether HipChat clients should also be notified.
    8. Click on Update to add the post function and move it below the Create issue post function.
    9. Publish the draft to apply the changes.

The Add Parameters To Function window looks something like the following screenshot:

How to do it…

Note

You must place the post function below the Creates the issue originally post function.

How it works…

In order for any application to integrate with and make remote API calls to HipChat, an API token must be used.

Out of the box, HipChat integration works by using post functions that trigger JIRA to send notifications to HipChat. Since we added the Notify hipchat post function to the Create Issue transition, every time an issue is created, a notification message is sent to the selected HipChat room.

Note that we moved the post function down the list. This is necessary as we are doing this on the Create Issue transition, so we need the issue to be created before we send the notification; otherwise, the notification will not contain the issue key or the link to the issue. Since this integration is based on post functions, we can add the trigger to any transitions in the workflow.

The JQL field in the post function allows us to limit what JIRA will send to HipChat. For example, we can use the following JQL to only send issues of the Support Request type:

issuetype = "Support Request"
How it works…

There's more…

Other than the out-of-the-box HipChat integration, there is also another third-party add-on that adds more features and capabilities. With this add-on, you can do the following:

  • Send notifications to HipChat rooms based on events in JIRA on a per project basis
  • The administrators will be able to send announcements to select HipChat rooms

You can get the add-on from the following link:

https://marketplace.atlassian.com/plugins/com.go2group.hipchat.hipchat-plugin

Apart from HipChat, there are many other chat applications out there that can be integrated with JIRA. For example, you can integrate JIRA with IBM Sametime using the Sametime integration add-on; it can be downloaded from the following link:

http://www.appfusions.com/display/SAMETIME/Home

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset