HipChat.room.create populating given parameters?

Hello,

In addon.js in the public/js directory of a HipChat template project (atlas-connect), I'm trying to call:

$('#create-room-private').on('click', function () {
    var roomName = currentUser = HipChat.user.getCurrentUser(
      function(err, success) {
        if (err) { $('#show-users').html('cannot get current user'); }
        else { $('#show-users').html(roomName); }
    });
    HipChat.room.create(roomName, "", "private");
  });

It does indeed show the create room dialog on the client, but the room name, topic, and privacy is not populated.

I have tried using a string literal as the room name to isolate it to only the .create call, but the behavior does not change.

My goal is to be able to create a private room and use the existing suggestions in the create room dialog to invite other users. Else I'd have to store all users with a backend API /user call and implement the suggestions manually.. 

Am I not using the javascript API correctly or is it a known issue?

Thank you.

1 answer

1 accepted

Angelo,

There was a regression on our end that prevents the name and topic to show up in the room creation dialog. You can subscribe to https://jira.atlassian.com/browse/HCPUB-890 to follow its progress.

You'll also need to change your code slightly: The getCurrentUser method doesn't return a value, but the user is passed to the callback. So you'd need to use something like:

HipChat.user.getCurrentUser(function(err, user) {
 HipChat.room.create(user.name, "", "private");
});

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Mar 26, 2018 in Hipchat Data Center

Migration of Hipchat server to Data Center - a retrospective

Background While our Hipchat server environment was reliable and performing well, as a significant and growing part of our business, the need to leverage the benefits of Hipchat Data Center&nbs...

458 views 2 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you