tag:help.lighthouseapp.com,2008-09-20:/discussions/api-developers/48-acccessing-ticketbody-using-ruby-api-wrapperLighthouse: Discussion 2012-06-29T22:05:02Ztag:help.lighthouseapp.com,2008-09-20:Comment/156852008-11-13T22:46:55Z2009-06-20T20:04:23Zacccessing ticket.body (using Ruby API wrapper)<div><p>The body attribute is a special case, because ActiveResource
would basically send the same value if all you did was change the
state. You can get the comment history of a ticket if you find a
single ticket:</p>
<pre>
<code class=
"ruby">ticket = Lighthouse::Ticket.find 1, :params => {:project_id => 1}
ticket.versions.each do |version|
puts version.body
end</code>
</pre></div>Ricktag:help.lighthouseapp.com,2008-09-20:Comment/156852008-11-13T23:12:02Z2009-06-20T20:04:23Zacccessing ticket.body (using Ruby API wrapper)<div><p>great, thanks for the prompt and helpful response!</p>
<p>that was all I needed. :)</p></div>Krister Axeltag:help.lighthouseapp.com,2008-09-20:Comment/156852008-12-11T21:44:04Z2009-06-20T20:10:07Zacccessing ticket.body (using Ruby API wrapper)<div><p>That is exactly the code I want, but I always get this error</p>
<p>undefined method ‘versions’ for
#<Lighthouse::Ticket:0x580d04> (on the ticket.versions
line)</p>
<p>when running your code against the following code</p>
<p>projects = Lighthouse::Project.find(:all) project =
projects[0]</p>
<p>tickets = Lighthouse::Ticket.find :all, :params =>
{:project_id => project.id} ticket = tickets[0] puts
"ticket.title: #{ticket.title}" ticket.versions.each do |version|
puts version.body end</p></div>paul (at 8thlight)tag:help.lighthouseapp.com,2008-09-20:Comment/156852008-12-12T16:59:41Z2009-06-20T20:10:16Zacccessing ticket.body (using Ruby API wrapper)<div><p>I figured out what my problem is. When you get tickets as an
array of tickets, they don't have versions. You have to do a search
for the specific ticket to get the version information.</p></div>paul (at 8thlight)