Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I send hipchat room an alias command

Kirk Friedman September 12, 2016

I have an alias setup in a test room

/alias set @kftest <some set of users>

that works fine.  What I want to do is use a curl command or send some json body in a command to that HipChat room so that the alias is triggered.

Simple things like:

curl -d '{"message": "@kftest from desktop", "notify": false, "messageformat": "html"}' -H 'Content-Type: application/json' <my room location and auth token> 

only repeat the message 

Its not obvious by looking at https://www.hipchat.com/docs/apiv2/webhooks if there is a setting.  I tried using "mentions" : "mention_name" : @kftest  

with no luck.  Any ideas?

1 answer

0 votes
crivers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2016

If you set message_format to "text" instead of "html", the Alias trigger should work. HTML-based messages don't trigger normal parsing, which causes addons like Alias to not pick up @-mentions

Kirk Friedman September 13, 2016

That did not work either.

curl -d '{"message": "@kftest from desktop", "notify": false, "messageformat": "text"}' -H 'Content-Type: application/json' <my room location and auth token> 

produces the same result

Kirk Friedman September 19, 2017

I noticed that I should have used "message_format" instead of "messageformat" but this didn't help.  Trying

curl -d '{"message": "@kftest Notification from Desktop", "notify": false, "message_format": "text"}' -H 'Content-Type: application/json' <my room location and auth token> got back :

@kftest Notification from Desktop

but didn't actually trigger the alias.  Any other ideas

Michael Grant April 5, 2018

I've been bashing my head today against the same problem; my team is using an alias to notify whoever's on support, and it would be really helpful if we could automate the daily handover of support duty through running "/alias set" programmatically through the HipChat API.  Any chance of an update on this, @crivers (or anyone else)?

rene dikstra November 14, 2018

Hi Michael,

you probably already found it, but just in case!

If you use a token with scope "Send message" and use the "/v2/room/{room_id_or_name}/message?<your token?" api, it works for me

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events