The Omni Group Forums

The Omni Group Forums (
-   OmniPlan Extras (
-   -   OmniPlan and Jira (

adupre 2008-04-26 08:00 AM

OmniPlan and Jira
I have been using OmniGraffle and OmniFocus and these applications rock!
So it was natural for me to turn to OmniPlan when the time came to start managing our department's software releases.
I have given it a go and it's a great tool in the same vein as the other two tools I am already using.
My organization uses Jira for issue tracking which is also a great tool and I would really like to tie the too together.
I was originally thinking of using the export feature of OmniPlan, but there would be no way for information to trickle from Jira back into OmniPlan.
Jira exposes a SOAP Api that I could certainly leverage, and while I have very little experience with AppleScript, I was wondering if I could leverage it to help with synchronization.
Thoughts and pointers would be very helpful.

traneHead 2008-05-09 02:33 AM

Me too!
Me too... I'm addicted to OmniFocus and it would be great if there was some way to syncronize between a project in Jira and one in OF.

adupre 2008-05-09 07:12 AM

Here's a start
Here's what I wrote, using AppleScript and leveraging the Omniplan API and the XMLRPC API.

It should be fairly self explanatory.
But here's the idea:
in Omniplan:
- on resources, add the custom field 'jira-user' and populate accordingly
- on tasks, add the custom field 'jira-id'. If populated, set to either the JIRA issue key or C if it is to be created by the script. (no value means it won't be handled by the script).

Open the project in question in Omniplan, run the script (from the Script Editor tool, with event log tab clicked to see the output, and potential errors).

I would recommend that you practice with a blank JIRA project :)

This script is alpha grade but I have been using it for a few weeks now and it works fine for my needs.

Feedback is welcome.

[CODE]set login to "mylogin"
set passwd to "mypass"
set jiraProject to "PROJ"
set jiraReporter to "a_usrname"

on jiraUserForTask(_task)
using terms from application "OmniPlan"
set assignee to resource of item 1 of assignments of _task
if assignee is not equal to missing value then
set entries to custom data entries of assignee
repeat with i from 1 to count of entries
set entry to item i of entries
set v to value of entry
if name of entry is equal to "jira-user" and v is not missing value then
return v
end if
end repeat
end if
return missing value
end using terms from
end jiraUserForTask

on syncTaskToJira(_task, entry)
using terms from application "OmniPlan"
set entryKey to value of entry
tell application ""
--if assignee of issue does not equal to _task
set assignee to my jiraUserForTask(_task)
if assignee is not equal to missing value then
set t to call xmlrpc {method name:"jira1.login", parameters:{my login, my passwd}}

if entryKey is equal to "C" then -- create
set issue to call xmlrpc {method name:"jira1.createIssue", parameters:{t, {project:my jiraProject, summary:name of _task, type:"3", assignee:assignee, reporter:my jiraReporter}}}

tell application "OmniPlan"
set value of entry to |key| of issue
set entryKey to value of entry
end tell
set issue to call xmlrpc {method name:"jira1.getIssue", parameters:{t, entryKey}}
end if

-- Update the effort (timetracking in Jira)
tell application "OmniPlan"
set _effort to ((effort of _task) / (60 * 60)) as integer
if _effort < 8 then
set _effort to "" & _effort & "h"
set _effort to "" & ((_effort / 8) as integer) & "d"
end if
end tell

-- Reset effort + assignee
set issue to call xmlrpc {method name:"jira1.updateIssue", parameters:{t, entryKey, {timetracking:{_effort}}}}
set issue to call xmlrpc {method name:"jira1.updateIssue", parameters:{t, entryKey, {assignee:{assignee}}}}

end if
end tell
end using terms from
end syncTaskToJira

on handleTask(_task)
using terms from application "OmniPlan"
--tell task _task
set entries to custom data entries of _task
repeat with i from 1 to count of entries
set entry to item i of entries
set v to value of entry
if name of entry is equal to "jira-id" and v is not missing value then
my syncTaskToJira(_task, entry)
end if
end repeat

set subs to child tasks of _task
if subs is not missing value then
repeat with i from 1 to the count of subs
my handleTask(item i of subs)
end repeat
end if
end using terms from
end handleTask

tell application "OmniPlan"
set _window to front window
set _document to document of _window
set _project to project of my _document
set _tasks to tasks of _project
set selTasks to selected tasks of front window

repeat with i from 1 to the count of selTasks
my handleTask(item i of selTasks)
end repeat
end tell

traneHead 2008-05-11 10:58 PM

Wow, thanks adupre!
I'll try it out with OmniFocus and get back about my findings.

kayrat 2008-06-03 08:40 AM

jira integration
Did you try it?
How it works?

Can we vote for massive Jira integration in Omni products?

jsade 2008-06-24 02:50 AM

Good job!
I was looking for something like this so that I wouldn't have to do my own. This is a good start. Perhaps we'll someday see an actual integration between these two great products!


By the way, has any of you implemented two way synchronization between OmniPlan and JIRA? Scopes and schedules tend to change so this would be a must. I can try fiddling with Applescript if no one has done this yet.


siberian 2008-11-10 01:42 PM

Jira <-> OmniPlan
I am working on a 2 way sync between Jira <-> OmniPlan for my own purposes. Anyone want to test it in a few weeks?

The philosophy here is 'Jira Is Authoritative' since it is the primary workflow tool and OP is a reflection of that tool. This means that Jira->OP is a full additive/nesting workflow while OP->Jira is just task progress updates.

This is a native mac app that you provide connection details to for jira, pick a jira filter to work with and specify an omniplan file. Once the profile is registered you can select Sync From Jira or Sync From OmniPlan. You need to set-up your omniplan project with some presets to match Jira fields (Key etc) but a sample document is included as a base.

When you sync from Jira it pulls your filter and attempts to update each item in the indicated OP document. It then adds left over items. It automatically appends sub-tasks as indents to maintain some usability but it does -not- auto-link items since you may need multiple levels of nesting. I need to work on this feature a bit more..

When you sync from OP it goes through each item and attempts to update jira from OP for task progress and nothing else.

Anyhow, progress is moving well on this project and if anyone wants to test it let me know.


tswicegood 2009-01-06 05:33 AM

Plans for OmniFocus?
@siberian: I would be interested in looking at what you have. I'm really looking for an OmniFocus <-> Jira tool, but OmniPlan might get me close. Please ping me if you're still looking for testers.


siberian 2009-01-06 06:28 AM

A bit behind schedule..
A bit behind schedule on this but as soon as I have something I'll post here.


cemerick 2009-01-28 02:36 AM

I'd love to see something like this for FogBugz, FWIW. It has a very accessible web API, although I'm all thumbs with applescript...

All times are GMT -8. The time now is 03:23 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.