devondragon/jira-omnifocus

Crashing on bad issue URI

geordan opened this issue · 3 comments

Error when running .jiraomnifocus.rb

./jiraomnifocus.rb:240:in `block (2 levels) in mark_resolved_jira_tickets_as_complete_in_omnifocus': undefined local variable or method `issue' for main:Object (NameError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:852:in `start'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:582:in `start'
    from ./jiraomnifocus.rb:211:in `block in mark_resolved_jira_tickets_as_complete_in_omnifocus'
    from ./jiraomnifocus.rb:201:in `each'
    from ./jiraomnifocus.rb:201:in `find'
    from ./jiraomnifocus.rb:201:in `each'
    from ./jiraomnifocus.rb:201:in `mark_resolved_jira_tickets_as_complete_in_omnifocus'
    from ./jiraomnifocus.rb:254:in `main'
    from ./jiraomnifocus.rb:258:in `<main>'

So I changed line 206 of jiraomnifocus.rb to the following in an attempt to see what issue was causing the... issue.

# check status of the jira
  uri = URI(JIRA_BASE_URL + '/rest/api/2/issue/' + jira_id)
  puts jira_id

Apparently it's trying to look at "http://intranet/jira/secure/admin/SDMailInfo.jspa"

The SDMailInfo.jspa thing is related to Service Desk, which I don't have to test against. It looks like it's grabbing a bad URL from a task note(s) in one of your OmniFocus tasks. Is this happening for all your Jira ticket related OF Tasks? Or do you just have one weird task with an odd link in the note?

Ah, that was it. I removed the note from a task that referenced the URL
http://intranet/jira/secure/admin/SDMailInfo.jspa and everything is happy
again.

On Mon, Oct 19, 2015 at 7:17 PM, Devon Hillard notifications@github.com
wrote:

The SDMailInfo.jspa thing is related to Service Desk, which I don't have
to test against. It looks like it's grabbing a bad URL from a task note(s)
in one of your OmniFocus tasks. Is this happening for all your Jira ticket
related OF Tasks? Or do you just have one weird task with an odd link in
the note?


Reply to this email directly or view it on GitHub
#16 (comment)
.

Glad I could help!

If other people start running into this, I could try to make the logic a bit smarter, but for now I'll hope it was a rare snafu!