#1109 open
Gaspard Bucher

cannot update milestone through ruby API

Reported by Gaspard Bucher | September 3rd, 2008 @ 04:41 AM

Cannot update milestone id after import from trac...

Am I doing something wrong here ?

command used

  ticket = Lighthouse::Ticket.find(1, :params => {:project_id => trac_ticket[:project_id]})
  ticket.milestone = mile
  ticket.save

error raised

Failed with 500 Internal Server Error (ActiveResource::ServerError)

from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.1.0/lib/active_resource/connection.rb:144:in `request'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.1.0/lib/active_resource/connection.rb:121:in `put'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.1.0/lib/active_resource/base.rb:929:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.1.0/lib/active_resource/base.rb:779:in `save_without_validation'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.1.0/lib/active_resource/validations.rb:262:in `save_without_tags'
from ./lighthouse.rb:178:in `save'

Comments and changes to this ticket

  • Gaspard Bucher

    Gaspard Bucher September 3rd, 2008 @ 06:00 AM

    • → Tag changed from “@high error” to “error”

    The "mile" value in the test above was a milestone_id, so changing the code to:

    ticket = Lighthouse::Ticket.find(1, :params => {:project_id => trac_ticket[:project_id]}) ticket.milestone_id = mile ticket.save

    Solved the problem !

    The only bug left is error reporting

    "Failed with 500 Internal Server Error ('invalid milestone type, expecting Milestone, found Fixnum')"

    would be so much easier to understand then

    Failed with 500 Internal Server Error (ActiveResource::ServerError)

  • Will

    Will October 27th, 2008 @ 10:23 AM

    • → Tag cleared.
    • → State changed from “new” to “open”
    • → Assigned user changed from “” to “rick”

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Using Lighthouse to track Lighthouse.

Shared Ticket Bins

People watching this ticket