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

"HipChat for JIRA" plugin integration automation

Dylan Vinesett October 13, 2015

I am working with a JIRA server and a HipChat server with project names equivalent to room names. In the HipChat for JIRA integration page for the plugin (where you map projects to rooms) I want to automate the process of mapping all of the JIRA projects to HipChat rooms. I found that the plugin comes with some REST endpoints (e.g. hipchat/integrations/1.0/configuration). The REST API browser shows me a bunch of URLs but most of the POSTed methods don't have any label use of their request body. Unfortunately, I couldn't find any documentation or use of this on the internet. Can someone provide any guidance on this problem?

 

Note:

JIRA v6.4.7

HipChat v1.3 b1.3.5

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

2 votes
Anatoli
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 13, 2015

Hi Dylan,

indeed you can use the internal REST endpoints to automate configuration. We didn't make it public hence we didn't document it. You can easily reverse engineer the calls using chrome's network console. 

As with every private APIs we do reserve the right to change it in new versions, however currently we don't have any plans to do it. In fact it is pretty stable and you can use for your small automation project (given all the 'it is a private API' caveats) .

Dylan Vinesett November 12, 2015

I've made progress on this, albeit slowly as it isn't my main focus. "POST @ rest/hipchat/integrations/1.0/mapping/{projectKey}" is the REST call I was looking for. The plugin's request payload includes parameters such as projectId, projectKey, projectName, roomId, roomName, etc, but only roomId is required (as well as "name" if you want to set up notifications). It works mostly as intended except that POSTing again creates another integration (as I understand, these are each webhooks. Is this correct?). That is expected with POST. I need the functionality to not have multiple of the same integrations. The REST call has a PUT method for the same URL, but does not seem to work with any combination of parameters I've tried. Besides PUT, I have tried to look through the webhooks exposed by HipChat's REST API, but was not able to find any information regarding a specific JIRA project's notifcations and a HipChat room (I did find a general webhook for the entire plugin. Maybe my understanding of how the integrations are saved is incorrect). I realize I can parse the html of the "HipChat Integration" plugin config page to find already-integrated projects, but this seems like the wrong path. I have also tried using the DELETE method of the REST call mentioned earlier and then POSTing a new integration with every pass of my automation. however, just as PUT doesn't seem to work for me, DELETE acts the same way. It should be noted that to my knowledge, I am using these REST calls exactly as I see them in the chrome network console. I realize that this response was mostly rambling. I wanted to see if I have skipped over any obvious option. Also, do you think that my findings merit writing another question or should further discussion continue on this page?

TAGS
AUG Leaders

Atlassian Community Events