Update JIRA-issues with OmniFocus

I’ve been using OmniFocus for my tasks for a while now, and i am very satisfied. Since JIRA is our issue-tracker of choice at Liip, i want to handle those tasks from within OmniFocus as well. As soon as i got them imported with this script i began to assemble some applescript.

Thanks to the defer-script of Daniel N. Byler and the omniplan-to-jira-script i was even able to get something working (even though my applescript-experience is close to zero) – so THANKS A LOT for publishing it! I can now update the estimation-time, the due-date and the assignee directly from OmniFocus in JIRA. The assignee is the context in my OmniFocus.

And then, here is my setup:

Import all your jira-tasks right your inbox with the Hackerdude’s “Jira to  Omnifocus”-Ruby-Script.

Now open your Terminal and go:

mkdir -p ~/Library/Scripts/Applications/OmniFocus/
cd ~/Library/Scripts/Applications/OmniFocus/
wget https://svn.liip.ch/repos/public/misc/omtoji/tags/0.1/omtoji.scpt
chmod 600 omtoji.scpt
open omtoji.scpt

Set your username and password on top of the file and save it.

In OmniFocus, right click on the toolbar and select “customize toolbar”. There you can drag “omtoji.scpt” up to have a shortcut. now select a task and change a value, such as the estimation time, enter and hit the script in your toolbar. Check the issue in jira, it should be updated with the values in OmniFocus. In my setup, each JIRA-user is a context in OmniFocus. So if you change the context and run the script, the assignee will be changed. You may trigger the script with the help of fastscripts even faster.

Patches are of course very welcome. Especially that ugly “reformat the date-“line of code 🙂 But worksforme and doesthejob. So well… a closer integration with the importer would be nice as well, if someone is fit in talking ruby this might be a appreciated task 🙂

It would be nice if information as the fixfor-version or the due-date would be integrated as well, but so far for now. 🙂

10 thoughts on “Update JIRA-issues with OmniFocus”

  1. Hi Alain,
    I got to love OmniFocus and use Jira at work, so it was a short step to hit your page. I’m unfortunately fairly new to AppleScript ran into problem compiling your script saying around “due date” end of line was expected and the like. So I think there must be something wrong with my setup – any help you could give me?

    Cheers, Markus

  2. Hi Markus

    I was able to reproduce your message in the script-editor hitting the compile-button. There is no need to compile that script really. i just used textmate, there i can save that, and also execute just fine afterwards. if you figure how to “compile” with the script-editor, i will adjust that 🙂

    hth
    Alain

  3. I am also a freshman with OmniFocus and at first I had some troubles with the scripts, but after a day or two of work everything was settled and I am now completely satisfied.

  4. Regarding your date formatting: I had to change it anyway since php comes back with warnings which are misinterpreted by the xmlrpc.

    I replaced the php call
    set formattedDate to (do shell script “php -r “echo gmdate(‘d/M/y’, strtotime(‘” & aDate & “‘));””) as string

    with
    set theFormatedDate to my getFormattedDate(theDueDate)

    using
    on getFormattedDate(aDate)
    set formattedDate to “”
    –set formattedDate to (do shell script “php -r “echo gmdate(‘d/M/y’, strtotime(‘” & aDate & “‘));””) as string — ugly formater “15/Apr/09”
    set shortDate to short date string of aDate
    set shortMonth to text monthPointerDE thru (monthPointerDE + 1) of shortDate as integer
    set aDay to day of aDate as string
    set aYear to year of aDate as string
    set aYear to text 3 thru 4 of aYear –only valid for 2000-2099
    set aMonth to item shortMonth of monthTagsDE
    set formattedDate to aDay & “/” & aMonth & “/” & aYear
    notify(“foo”, “foo”, formattedDate)
    formattedDate
    end getFormattedDate

    and
    property monthTagsDE : {“jan”, “feb”, “mar”, “apr”, “mai”, “jun”, “jul”, “aug”, “sep”, “okt”, “nov”, “dez”}
    property monthPointerDE : 4

    The only drawback is that it depends on the date format used by AppleScript, so it’s not automatically localized.
    Change the two properties to reflect your region settings (here it is done for Germany).

    Regards
    Gerd

Leave a Reply

Your email address will not be published. Required fields are marked *