Method: RT_Client#comment

Defined in:
rt_client.rb

#comment(field_hash) ⇒ Object

Comment on a ticket. Requires a hash, which must have an :id key containing the ticket number. Returns the REST response. For a list of fields you can use in a comment, try “/opt/rt3/bin/rt comment ticket/1”

rt.comment( :id   => id,
            :Text => "Oh dear, I wonder if the hip smells like almonds?",
            :Attachment => "/tmp/almonds.gif" )


303
304
305
306
307
308
309
310
311
312
# File 'rt_client.rb', line 303

def comment(field_hash)
  if field_hash.has_key? :id
    id = field_hash[:id]
  else
    raise "RT_Client.comment requires a Ticket number in the 'id' key."
  end
  field_hash[:Action] = "comment"
  payload = compose(field_hash)
  @site["ticket/#{id}/comment"].post payload
end