It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Send Hipchat Message via Scripting Lanugage?

I am scripting within a scripting lanugage called Pnuts. I am automating our migration process and would like to incorporate a way to send notifications to our teams room within the script itself. Basically, when the user selects "Create Migration" then pnuts code will send a message to our teams hipchat room stating "A new migration was created by _____________. " or something like that.

 

Basically, looking for a way to have my code automate the messaging functionality to hipchat.

1 answer

0 votes
ryans Atlassian Team Sep 06, 2017

Hi Trevor,

I'm not familiar with Pnuts, but to send a message to a specific Hipchat room you could use the API interface.

For example to send a message to room 6 you could use the command:

curl -d '{"message": "A new migration was created by $variable.", "notify": false, "message_format": "text"}' -H 'Content-Type: application/json' 'https://<hipchatserver>/v2/room/6/message?auth_token=xxxxxxxxxxxxxxxxxxxx'

A using the send_message endpoint only allows you to use text, so perhap, if you want the message to standout use the send_room_notification endpoint, which has a more extensive configuration

Have a look at the full API reference at
https://www.hipchat.com/docs/apiv2/method/send_message - to send a text message
https://www.hipchat.com/docs/apiv2/method/send_room_notification - to send a notification, for example in html

Note:
To be able to make API calls you will need to create an API token first
An API tokens can be created in your profile settings when you are logged in with the webinterface.

Best Regards,

Ryans

Where would I run that command from?... command line? if so do i have to install anything or be in a certain environment to actually be able to run the command?

ryans Atlassian Team Sep 06, 2017

Hi Trevor

The curl command can be executed from the terminal on any system that has curl installed.

Most linux/unix/OS X systems have that pre installed.

note:

The curl command was only an example how make the API call. Any application that can make json API calls would do.

Best Regards,

Ryans

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Hipchat

Hipchat Cloud and Stride have reached End of Life (updated)

All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us.  As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...

35,198 views 9 8
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you