FishEye 2.7 comes with Smart Commits! Read about it!

So, you’ve slayed the Atlassian integration dragon. But you’re still edgy, it was too easy! You want something harder. Well I have just the task for you. Actioning JIRA issues from Subversion commit messages. Before I go on, let me say, this task is not part of the official Atlassian Dragon Quest. This feature is not supported either, so use at your own risk. You will not get another free tshirt if you complete this task. But, you will get one cool integration feature from Atlassian’s products.

Actioning issues from commit messages is a feature that has been available in JIRA Studio for around a year. The documentation on how to use it (once it’s set up) can be found here. This feature was, from the start, written as a feature that could be used outside JIRA Studio. However, there was a small amount of effort required to get it to that point. That effort has never been done, until now. Well, some of it has been done. It’s still only recommended to be tried by only the bravest of dragon slayers.

First, a bit about how actioning issues with commit commands work. Atlassian has a little known cross product plugin called the Atlassian Notifier. This plugin implements WebHooks for Atlassian products. Using a REST interface, other servers can subscribe to notifications of events on the Atlassian product. In our case, a servlet in the JIRA FishEye plugin will subscribe to commit notifications from FishEye, this servlet will parse the commit messages, and action JIRA issues accordingly.

Requirements

In order to complete this task, you will need:

  • To have completed the Atlassian Dragon Quest
  • Version 3.1-beta2 of the JIRA FishEye plugin, available here
  • A patch for the built in JIRA workflow
  • The FishEye Atlassian Notifier plugin version 2.1-beta1, available here. If using FishEye 2.2, then you need version 2.2 of the Notifier plugin, which is available here, and you also need an updated SAL plugin, available here.
  • A Subversion repository that you can commit to (can be a local filesystem repository)
  • The Firefox Poster plugin

Setup

  1. Install the JIRA FishEye plugin 3.1-beta1 into the plugins/installed-plugins directory in the JIRA home directory
  2. From the atlassian-jira directory, apply the workflow patch, using the command patch -p0 < jira-workflow.xml.patch
  3. Restart JIRA
  4. Install the FishEye Atlassian Notifier Plugin into the var/plugins/user directory in FishEye, and the updated SAL plugin if using FishEye 2.2.
  5. Restart FishEye
  6. Add your Subversion repository to FishEye.
  7. Grant the “charlie” user you created administrator access to FishEye. This can be done by clicking the Administrators link in the FishEye administration menu.
  8. In Firefox, log in to FishEye with the charlie user. Now, using the Firefox Poster plugin, send a POST request to {your fisheye base url}/plugins/servlet/notifier/{your repository}/COMMIT, with content type application/x-www-form-urlencoded, and the content url={your jira base url}/plugins/servlet/commitnotification&authenticationType=TRUSTED_APPS&username=charlie. The response code should be 201 Created.

You’re now ready to go.

Testing

  1. Create an issue in JIRA
  2. Check out your source code. If using a file system SVN repository, make sure you specify the –username charlie option.
  3. Make a change, and then commit, with a commit message of {ISSUEKEY} #resolve It works

Within a couple of minutes, your issue should be resolved, and a comment “It works” added to the issue.

If these instructions don’t work for you (remember, this task was not for the faint hearted!), then please leave your feedback as comments on this post.