zendesk2 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zendesk2/client/requests/create_ticket.rb +6 -4
- data/lib/zendesk2/version.rb +1 -1
- data/spec/tickets_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b95ffa24bf712a96c513713ff2391292f4ec0ce2
|
4
|
+
data.tar.gz: 32e7be8ce3b6ad0cc881294ef508d0689a482126
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abdb21b9a7e04733d3144d0e828eed85740a463270a15c6dc8db0c9b91940f0b245ab4f4f3d4857968ee92da819202cbae494cb90a60acbf0b67cb3eaa563597
|
7
|
+
data.tar.gz: 1ac672a42025afcb24e7dcbf0c0ac9a88a8ecc2154bc81f624630dbc7cc5ea115195c03bc445429a6613b837e8f4fb7fc7d2c5f2b332d0adbcf0b5d8f785caab
|
@@ -51,15 +51,17 @@ class Zendesk2::Client
|
|
51
51
|
requested_custom_fields = (params.delete("custom_fields") || [])
|
52
52
|
|
53
53
|
custom_fields = requested_custom_fields.map do |cf|
|
54
|
-
field_id = cf["id"].
|
55
|
-
if self.data[:ticket_fields][field_id]
|
54
|
+
field_id = cf["id"].to_i
|
55
|
+
if self.data[:ticket_fields][field_id.to_s]
|
56
56
|
{"id" => field_id, "value" => cf["value"] }
|
57
|
+
else
|
58
|
+
# @fixme error ?!
|
57
59
|
end
|
58
60
|
end.compact
|
59
61
|
|
60
62
|
self.data[:ticket_fields].each do |field_id, field|
|
61
|
-
requested_custom_fields.find { |cf| cf["id"] == field_id.
|
62
|
-
custom_fields << {"id" => field_id.
|
63
|
+
requested_custom_fields.find { |cf| cf["id"].to_i == field_id.to_i } ||
|
64
|
+
custom_fields << {"id" => field_id.to_i, "value" => nil }
|
63
65
|
end
|
64
66
|
|
65
67
|
record = {
|
data/lib/zendesk2/version.rb
CHANGED
data/spec/tickets_spec.rb
CHANGED
@@ -135,9 +135,9 @@ describe "Zendesk2::Client" do
|
|
135
135
|
expect(custom_field["value"]).to be_nil
|
136
136
|
|
137
137
|
ticket = client.tickets.create!(subject: mock_uuid, description: mock_uuid, custom_fields: [{"id" => ticket_field.identity, "value" => "jessicaspacekat"}])
|
138
|
-
custom_field = ticket.custom_fields.find { |cf| cf["id"].
|
138
|
+
custom_field = ticket.custom_fields.find { |cf| cf["id"].to_i == ticket_field.identity.to_i }
|
139
139
|
|
140
|
-
expect(custom_field).
|
140
|
+
expect(custom_field).to be
|
141
141
|
expect(custom_field["value"]).to eq("jessicaspacekat")
|
142
142
|
|
143
143
|
ticket = client.tickets.create!(subject: mock_uuid, description: mock_uuid, custom_fields: [{"id" => "-1", "value" => "fantasy"}])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|