Posting a new ticket with tags crashes, but works

Subscribe to Posting a new ticket with tags crashes, but works 3 post(s), 2 voice(s)

 
Avatar Alex Wayne 2 post(s)

Regarding the Lighthouse ruby framework, if I post a new ticket with something like:

ticket = Lighthouse::Ticket.new(:project_id => project_id)
ticket.title = 'foo'
ticket.tag   = 'defect'
ticket.save

I get an argument error in the ActiveResource internals “Expected Hash got ‘defect’”. But the odd thing is that the ticket makes it to lighthouse with the tag intact, but the script crashes.

So currently I just wrapping it in in a begin/rescue ArgumentError block, but thats hardly any fun.

Thanks for the recent update BTW, it rocks.

 
Avatar rick Administator 546 post(s)

Try it with the latest version of the API (changes). You can now manipulate tags as an array like this:


t = Lighthouse::Ticket.new(:project_id => 1)
t.tags << 'defect' << '@high'
t.tags.delete '@high'
t.save

(be sure to get the absolute latest ActiveSupport and ActiveResource in vendor in the lighthouse api)

 
Avatar Alex Wayne 2 post(s)

Thank you much, that did the trick.