JIRA To Omnifocus Script
Mar 04
This script logs into your JIRA and creates OmniFocus tasks for each of the JIRA items that are assigned to you, so they sync to your Omnifocus for iPhone, you only have to keep track of one inbox, etc. It only takes a tiny bit of setup.
Setting up
To set this up, do the following:
- Download the script and put it somewhere it will run
- Install the required gems (appscript, crypt, password) with gem install.
- Go to JIRA and create a saved filter with whatever settings you like. Note the filter ID.
- Go to the top of the jiratoomnifocus file and set it on the JIRA_FILTER_ID constant, and set the JIRA_BASE_URL to the URL of your JIRA installation.
- If you like to keep your system very secure, take a look at the security warning, below, at this time
- Run it. You will be asked to login the first time. After it's done, note the new tasks on your Omnifocus. Delete a task and run it again to see it add it again without asking you for authentication.
You're set up! Now you can put it on a cron line, like this one which sets it to run at office hours (use cron -e on Terminal for this):
0,10,20,30,40,50 7-18 * * * /yourdir/jiratoomnifocus > /yourdir//log/jira_to_omnifocus.log 2>&1
Congratulations! You now have only one inbox again. Let me know if you use it; I'd love to know of more ideas on how we can make it better/easier to setup.
Security Warning
The password for your JIRA account will be saved on a file on your computer called ~/.hackerdude/jira_credentials.yml. It is encrypted using blowfish using a constant key.
As long as both your jiratoomnifocus script and your credentials file are secured as (chmod 700 and owned by the user that will be running it on cron), you should be okay and secure (unless someone breaks into your account, in which case you have bigger problems than your JIRA access!). The crypt key used is a constant on the jiratoomnifocus script. Change the CRYPT_KEY key for any other random string of the same length and delete the jira_credentials.yml file (so it asks for your password again) and it will be recreated using your key the next time you start it.
RSS
Apr 04, 2009 @ 11:47:25
Hi,
Thanks for publishing this script!
For me, it’s not really useful though, mainly for just one reason: When i move an issue from my omnifocus-inbox to a project, it will be reimportet by jiratoomnifocus next time it’s running, which leads to lots of duplicates.
If that’s resolved, it would help a lot
Alain
Apr 07, 2009 @ 00:15:00
Works for me. Had to install getopt also though.
Thanks a lot!
Apr 07, 2009 @ 11:14:38
Ah, Alain was right. I just uploaded a new version on the same URL that does take into account tasks in other sections of the file. You can now move the task to the folder and it won’t add duplicates.
Thanks for trying it out, and let me know if there’s other features you want (patches also welcome).
Apr 11, 2009 @ 04:36:46
Hi Hackerdude,
thanks a lot for the patch, that was fast
I have later learned, that one can have default contexts in projects, so when dragged the issues to a project, i just set the context like this and i circumvented the duplicates. but now it’s even better! i will try it out right on.
What i’d really like if it would also set the estimated time and the due-date (if one is set in JIRA)
I did some playing around with getting updated tasks back to JIRA. For now, i am able to update the estimated time and the due date. in my setup i also set the context in omnifocus to the same string as the username in JIRA. Like this i am able to reassign issues in JIRA (I will publish the script hopefully within the next days). Of course this is quite specific, but it would be cool if the importer supports that as well
So far…
Alain
Apr 11, 2009 @ 23:27:20
Here you find my script on how i did the updates of JIRA from within Omnifocus…
May 15, 2009 @ 18:37:59
Thanks so much or the great work. Alain I’m going to try your script out next. It would be nice to get these integrated. I’ll work on it a bit as well
I did have to download the getopt gem as well to get it to work
Jan 26, 2010 @ 09:26:54
Ruby 1.9 seems unhappy…
/usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:47:in `|’: can’t convert String into Integer (TypeError)
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:47:in `block (2 levels) in setup_blowfish’
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:46:in `times’
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:46:in `block in setup_blowfish’
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:44:in `upto’
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:44:in `setup_blowfish’
from /usr/local/lib/ruby/gems/1.9.1/gems/crypt-1.1.4/crypt/blowfish.rb:27:in `initialize’
Mar 22, 2010 @ 13:55:33
I depend on some libraries, so 1.9 compatibility depends on the libraries’ compatibility.
Crypt is not compatible with Ruby 1.9, but gem install crypt19 and it will get past that.
It looks like there’s also an appscript problem calling name.get on ruby1.9. May just be my install though. Using ruby 1.8.X seems to work correctly.