# HipChat Integration

**URL:** https://meta.discourse.org/t/hipchat-integration/77883
**Category:** Bug
**Created:** [January 12, 2018, 7:59pm UTC](https://meta.discourse.org/t/hipchat-integration/77883 "2018-01-12T19:59:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rohitsden](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rohitsden/32/87267_2.png) [@rohitsden](https://meta.discourse.org/u/rohitsden)
#### Post date: [January 12, 2018, 7:59pm UTC](https://meta.discourse.org/t/hipchat-integration/77883/1 "2018-01-12T19:59:14Z")

</div>

Hi,

Just setup Discourse and was working on HipChat integration.

**References:**

- [Discourse Chat Integrations](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522)
- [https://meta.discourse.org/t/set-up-hipchat-notifications-using-the-discourse-chat-integration-plugin/66734](https://meta.discourse.org/t/set-up-hipchat-notifications-using-the-discourse-chat-integration-plugin/66734)

Our HipChat setup uses a URL of the format: `hipchat.xyzcompany.com`. When setting up the HipChat Channel (Plugins\>Chat Integrations\>HipChat\>Add Channel), the Webhook URL does not support the format: `hipchat.xyzcompany.com`. It expects `hipchat.com` and so marks entries like `hipchat.xyzcompany.com` as invalid.

On looking up the code in:  
`/var/www/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/hipchat`

I see that the match is looking for `hipchat.com` as show below:

```
module DiscourseChat
  module Provider
    module HipchatProvider
      PROVIDER_NAME = "hipchat".freeze
      PROVIDER_ENABLED_SETTING = :chat_integration_hipchat_enabled
      CHANNEL_PARAMETERS = [
                        { key: "name", regex: '^\S+' },
                        { key: "webhook_url", regex: 'hipchat\.com'', unique: true, hidden: true },
                        { key: "color", regex: '^(yellow|green|red|purple|gray|random)$' }
                       ]

```

I believe this is a **BUG** and it should be able to address URLs such as `hipchat.xyzcompany.com`.

To test this out I went ahead and tried changing the code and restarted the app. On restart I was able to add `hipchat.xyzcompany.com` successfully.

Do let me know if you need any information.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [January 12, 2018, 8:09pm UTC](https://meta.discourse.org/t/hipchat-integration/77883/2 "2018-01-12T20:09:31Z")

</div>

Sounds like a good change to me, I didn’t realise custom hipchat domains were possible when I created the integration.

Are you confident creating a pull request for the change? If not I’m happy to do it :slight_smile:

---

<div class="post-metadata">

### Author: ![rohitsden](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rohitsden/32/87267_2.png) [@rohitsden](https://meta.discourse.org/u/rohitsden)
#### Post date: [January 13, 2018, 12:46am UTC](https://meta.discourse.org/t/hipchat-integration/77883/3 "2018-01-13T00:46:58Z")

</div>

Hi @david

Thanks for reviewing this. I just created a pull request (my first!).  
[https://github.com/discourse/discourse-chat-integration/pull/18](https://github.com/discourse/discourse-chat-integration/pull/18)

Please review whenever you get the chance.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 18, 2018, 4:43am UTC](https://meta.discourse.org/t/hipchat-integration/77883/4 "2018-04-18T04:43:37Z")

</div>

Is this all good now?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 1, 2018, 1:49am UTC](https://meta.discourse.org/t/hipchat-integration/77883/5 "2018-05-01T01:49:32Z")

</div>

Sorry for the huge delay, I just merged this! :clinking_glasses:

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [May 2, 2018, 8:00am UTC](https://meta.discourse.org/t/hipchat-integration/77883/6 "2018-05-02T08:00:07Z")

</div>

This topic was automatically closed after 30 hours. New replies are no longer allowed.
