-
Bug
-
Resolution: Fixed
-
Low
-
HCS 2.2.4
-
None
-
Severity 3 - Minor
Summary
hipchat email -r doesn't reset the email of the group owner. Instead, it resets the email of the user with id=1.
While the owner has id=1 by default, this command will not work properly in environments where the owner has been changed to a user with a different id.
Steps to Reproduce
- Login as a group owner, say owner.1@example.com which should have id=1
- Follow How to identify and change the Owner user in HipChat Server to transfer the ownership to another user, say owner.2@example.com
- Run hipchat service -r new.owner@example.com to change the email address of the new owner from owner.2@example.com to new.owner@example.com
Expected Results
The user email owner.2@example.com is changed to new.owner@example.com
Actual Results
The user email owner.1@example.com (id=1) will be changed to new.owner@example.com
Notes
Here's the function to fix in /opt/atlassian/hipchat/sbin/MyMySQL.py
def reset_owner_email(self, email): self.update_table('users', 'set email="{}" where id=1'.format(email)) self.update_table('users', 'set is_deleted=0 where id=1')
The group owner should be pulled from the group acl in the DB
Workaround
Reach out to the HipChat Support team to change the owner via a DB command.