ruby

/Tag: ruby

GitHub to OmniFocus Integration

I’m thrilled to announce that I’ve written a GitHub to OmniFocus integration.  Track your GitHub issues from OmniFocus automatically!

This Ruby script is based on my Jira to OmniFocus integration, but uses the Octokit gem to pull issues from GitHub instead of Jira.  You can find it on GitHub here: https://github.com/devondragon/github-omnifocus

It is simple to install, and can be run on a schedule via cron, or via a LaunchDaemon on OS X.  One notable difference from my Jira to OmniFocus integration is that this script puts the body of the GitHub issue into the Note of the OmniFocus task.  This feature may be coming as an enhancement to the Jira integration soon.

If you have any problems or enhancement requests please create a GitHub issue on the project.  Thanks!

Updated JIRA to Omnifocus Integration

Updates to my JIRA Omnifocus Integration

I have made some long over-due updates to the Jira OmniFocus integration I wrote a year ago.  Sean Kane provided a great pull request earlier this year where he’d made some massive improvements to the packaging and installation of the tool.  I just fixed a couple minor bugs, added support for syncing the Due Date of a Jira ticket to an OmniFocus task.  I also found a very inefficient scan of existing OmniFocus tasks, which I was able to improve.  For me this led to the script going from taking ~50 seconds, to now completing in about 2 seconds.  Not bad for modifying one line!

 

Where to get it

Find the latest Jira Omnifocus Integration code and install instructions here:  https://github.com/devondragon/jira-omnifocus

Please log any issues you find at GitHub issues and I will try to provide more timely support and enhancements as I am able.

Thanks!

–Devon

Jira to OmniFocus Integration

At Spark::red we use Jira extensively for internal projects and tasks, for alerts and issues, and for handling client support requests.  It’s a great tool.  I also use OmniFocus for other types of tasks: personal, errands, write an email to so-and-so, create a proposal, etc…  What that’s left me with is two separate to-do lists, that I have to check separately, which is a pain.

I finally started looking at possible integrations between the two tools, and I found several scripts that sync Jira tasks into OmniFocus.  Unfortunately every single one I tried didn’t work.  Either my version of Jira was too new (5.1.5), or my OmniFocus is too new (1.10.5), or my Ruby is too new, or various Ruby Gems wouldn’t install correctly, or the integration required massive additional library/software installation.

So while I was stuck in the San Francisco airport a few nights ago waiting for a very delayed flight home, I hacked up a simple Ruby script that does what I need it to do. I’ve never written anything in Ruby before, so it’s probably terribly written, but it works!  I have it running every 10 minutes as a cron job on my laptop.

What it does is two things:

It pulls back all unresolved Jira tickets that are assigned to you and if it hasn’t already created a OmniFocus task for that ticket, it creates a new one.  The title of the task is the Jira ticket number followed by the summary from the ticket.  The note part of the OmniFocus task is just the URL to the Jira ticket so you can easily go right to it.  I chose not to pull over the full description, or comment history into the task notes as it’s usually more than I want to see in OmniFocus.

It also checks all the OmniFocus tasks that look like they are related to Jira tickets, and checks to see if the matching ticket has been resolved.  If so, it marks the task as complete.

Very simple.  The Ruby code is straight forward and it should be easy to modify to do other things to meet your specific needs.

You will need to install a few gems

gem install rb-appscript json

You’ll need to edit the configuration values at the top of the script (please note this current version does not hide/encrypt your password), and then save it somewhere.  I have mine in /Users/devon/bin/ but you can put it anywhere.  Then you can add a cron entry to run it every 5 minutes or 10 minutes or whatever you need (it will take a minute or so to run so don’t make it run too often).

You can use crontab -e to edit your user crontab and create an entry like this:

*/10 * * * * /Users/devon/bin/jiraomnifocus.rb

That should be it!  If it doesn’t work, try adding some puts debug statements and running it manually.  I can’t offer any support, as I don’t know Ruby that well and just magically cobbled this together:)