ac3cloud / roust

Ruby client for Request Tracker's REST API
Other
6 stars 4 forks source link

Only the first AdminCc is being added during ticket creation #6

Closed Sarah-E-Greene closed 10 years ago

Sarah-E-Greene commented 10 years ago

When creating a ticket with multiple adminCCs, only the first is added:

pry(main)> attrs
=> {"Subject"=>"test subject",
 "Requestors"=>"a@hobbsee.com,b@hobbsee.com",
 "admincc"=>"c@hobbsee.com, d@hobbsee.com",
 "Queue"=>"support"}

The result is:

pry(main)> @rt.ticket_create(attrs)
=> {"Cc"=>[],
 "Subject"=>"test subject",
 "id"=>"123456",
 "Queue"=>"support",
 "Owner"=>"Nobody",
 "Creator"=>"automator",
 "Status"=>"new",
 "Priority"=>"101",
 "InitialPriority"=>"101",
 "FinalPriority"=>"100",
 "Requestors"=>["a@hobbsee.com", "b@hobbsee.com"],
 "AdminCc"=>["c@hobbsee.com"],
 "Created"=>"Mon Sep 08 17:46:18 2014",
 "Starts"=>"Not set",
 "Started"=>"Not set",
 "Due"=>"Tue Sep 09 17:46:18 2014",
 "Resolved"=>"Not set",
 "Told"=>"Not set",
 "LastUpdated"=>"Mon Sep 08 17:46:19 2014",
 "TimeEstimated"=>"0",
 "TimeWorked"=>"0",
 "TimeLeft"=>"0"}

Only one AdminCC is shown in RT as well.

auxesis commented 10 years ago

So ticket attribute case matters to RT :laughing: :laughing: :laughing: :laughing: :laughing: :sob: :skull:

attrs = {
 "Subject"=>"test subject",
 "Requestors"=>"a@hobbsee.com,b@hobbsee.com",
 "AdminCc"=>"c@hobbsee.com,d@hobbsee.com",
 "Queue"=>"support"
}

rt.ticket_create(attrs) # => {
  "Cc"=>[],
 "Subject"=>"test subject",
 "id"=>"1998864",
 "Queue"=>"support",
 "Owner"=>"Nobody",
 "Creator"=>"lindsay",
 "Status"=>"new",
 "Priority"=>"101",
 "InitialPriority"=>"101",
 "FinalPriority"=>"100",
 "Requestors"=>["a@hobbsee.com", "b@hobbsee.com"],
 "AdminCc"=>["c@hobbsee.com", "d@hobbsee.com"],
 "Created"=>"Mon Sep 08 18:53:42 2014",
 "Starts"=>"Not set",
 "Started"=>"Not set",
 "Due"=>"Tue Sep 09 18:53:42 2014",
 "Resolved"=>"Not set",
 "Told"=>"Not set",
 "LastUpdated"=>"Mon Sep 08 18:53:44 2014",
 "TimeEstimated"=>"0",
 "TimeWorked"=>"0",
 "TimeLeft"=>"0"
}

While this isn't strictly a bug in Roust, I'll add a renaming method that ensures the Requestors/Cc/AdminCc fields are appropriately cased.

Sarah-E-Greene commented 10 years ago

Thanks!