node package manager

my-hipchat-add-on

Atlassian Connect for HipChat add-on

This add-on shows how to use the basic blocks of the HipConnect API. In particular:

  • Contribute a glance
  • Click on the glance and open a sidebar view
  • From the sidebar view, open a dialog
  • Open a sidebar view from a message action, and access the message content
  • Open a dialog from a message action, and access the message content
  • update a glance by a call from the add-on back-end
  • Post an application card to a room

How to install

In the same directory:

Then, In a terminal window, run:

#!shell 
cd atlassian-connect-express-hipchat
git checkout support-pluggable-clients
npm link
cd ../hipchat-connect-sample
npm link atlassian-connect-express-hipchat    
 

Finally:

  • Install Redis
  • Install ngrok. Create an account with ngrok to be able to create custom subdomains.

How to run your add-on

Open 3 terminal windows.

  • In the first one, run
#!shell 
redis-server
  • In the second one, run
#!shell 
ngrok -subdomain yourSubdomainName 3000
  • In the 3rd one, run:
#!shell 
cd hipchat-connect-sample
npm install
AC_LOCAL_BASE_URL=https://yourSubdomainName.ngrok.com node app.js

Reading the repo

The Connect descriptor is atlassian-connect.json It is where the add-on declares how it wants to extend HipChat. In there I declared the dialog, glance, sidebar view and actions.

The main application router is index.js. That's what handles any request

Each view has a .hbs file in the views/ directory. The main ones are dialog.hbs and sidebar.hbs both have a corresponding javascript file in public/js (sidebar.js, dialog.js)

In layout.js, you can see the main imports.