gitlab_support_readiness 1.0.36 → 1.0.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 13950952a0154e8d77531bb3ac9e64373ca9b1a48707e43eb455ba9ab65a2ea5
4
- data.tar.gz: 3938db24450f52fb5069e1ee6e932e2f047f56899db442cc8f80e9a205c92a2a
3
+ metadata.gz: 9b1330c4fb2dc431a85de88f941a158751eb98d45431c567669d0913fe8bacd1
4
+ data.tar.gz: d40b44310ef4c8217507178164924e83faccf9827d843778a1b71b5562b5e313
5
5
  SHA512:
6
- metadata.gz: 67a775d1e90080ff3e37bfb7c500db214eb5dd073e8d756c5862bde1254f76ec2b4c98ae40991abb0c73ef85486c255b7788f77132126128b1f73da1e8d71d92
7
- data.tar.gz: 5092f72ca08b3a66bf29c57dc23e5655712fb71e295ad420dbf74c629da61fc4fce4fc4efa40d47dc65c33de7ce9a3866bca1ef491da18d8ee94f4f32fffe4d4
6
+ metadata.gz: 2a5ea2c78752e407c81cb86776a1e8d1ee2ac55ee7ebf1acfab7fe4c440c881efac6fcfad72fb1da4d0483c5f31bd8abb663af2d623e13c1387471848e87c445
7
+ data.tar.gz: 1635651da9633d04fd6ef1462ed3e5d233f3a0e5c1234bb674df719ed5eef698476b5f6114d9e052e23cadbcb3b56359eec9336fd80209dd4b8c5ac4518ab779
@@ -52,8 +52,8 @@ module Readiness
52
52
  repo.custom_field_options.map! { |o| Zendesk::TicketFieldOptions.new(o) } unless repo.custom_field_options.first.is_a? Object
53
53
  repo.custom_field_options.each do |repo_option|
54
54
  repo_option.position = repo.custom_field_options.index(repo_option) if repo_option.position.nil?
55
- zd_option = zd_options.detect { |zd_o| zd_o.name == repo_option.name }
56
- if zd_option.nil? || to_clean_json(zd_option) != to_clean_json(repo_option)
55
+ zd_option = zd.custom_field_options.detect { |zd_o| zd_o.value == repo_option.value }
56
+ if zd_option.nil? || option_difference?(zd_option, repo_option)
57
57
  @diffs[:option_updates].push({ "#{repo.title}" => repo_option })
58
58
  end
59
59
  end
@@ -69,6 +69,22 @@ module Readiness
69
69
  @diffs
70
70
  end
71
71
 
72
+ ##
73
+ # Deterine if there is a difference between the repo ticket field options to the Zendesk instance ticket field options
74
+ #
75
+ # @author Jason Colyer
76
+ # @since 1.0.38
77
+ # @param zd_option [Object] An instance of {Readiness::Zendesk::TicketFieldOptions}
78
+ # @param repo_option [Object] An instance of {Readiness::Zendesk::TicketFieldOptions}
79
+ # @return [Boolean]
80
+ def self.option_difference?(zd_option, repo_option)
81
+ return true if zd_option.name != repo_option.name
82
+ return true if zd_option.position != repo_option.position
83
+ return true if zd_option.value != repo_option.value
84
+
85
+ false
86
+ end
87
+
72
88
  ##
73
89
  # Outputs a comparison report
74
90
  #
@@ -174,9 +174,9 @@ module Readiness
174
174
  # config.token = 'test123abc'
175
175
  # config.url = 'https://example.zendesk.com/api/v2'
176
176
  # client = Readiness::Zendesk::Client.new(config)
177
- # ticket1 = Readiness::Zendesk::Tickets.find!(client, 1)
177
+ # ticket1 = Readiness::Zendesk::Tickets.find!(client, 1)
178
178
  # ticket1.status = 'solved'
179
- # ticket2 = Readiness::Zendesk::Tickets.find!(client, 2)
179
+ # ticket2 = Readiness::Zendesk::Tickets.find!(client, 2)
180
180
  # ticket2.status = 'pending'
181
181
  # tickets = [ticket1, ticket2]
182
182
  # updates = Readiness::Zendesk::Tickets.update_many!(client, tickets)
@@ -243,7 +243,7 @@ module Readiness
243
243
  # config.url = 'https://example.zendesk.com/api/v2'
244
244
  # client = Readiness::Zendesk::Client.new(config)
245
245
  # ticket = Readiness::Zendesk::Tickets.find!(client, 123456)
246
- # comments = Readiness::Zendesk::Tickets.find!(client, ticket)
246
+ # comments = Readiness::Zendesk::Tickets.comments(client, ticket)
247
247
  # pp creates.select { |c| c['public'] == false }.count
248
248
  # # => 12
249
249
  def self.comments(client, ticket, sort = 'created_at')
@@ -705,7 +705,7 @@ module Readiness
705
705
  # config.token = 'test123abc'
706
706
  # config.url = 'https://example.zendesk.com/api/v2'
707
707
  # client = Readiness::Zendesk::Client.new(config)
708
- # tickets = Readiness::Zendesk::Tickets.find!(client, [35436, 35437])
708
+ # tickets = Readiness::Zendesk::Tickets.find_many(client, [35436, 35437])
709
709
  # pp ticket.count
710
710
  # # => 2
711
711
  def self.find_many(client, tids)
@@ -864,7 +864,7 @@ module Readiness
864
864
  # config.url = 'https://example.zendesk.com/api/v2'
865
865
  # client = Readiness::Zendesk::Client.new(config)
866
866
  # ticket = Readiness::Zendesk::Tickets.find!(client, 141)
867
- # redaction = Readiness::Zendesk::Tickets.redact_attachments!(client, ticket)
867
+ # redaction = Readiness::Zendesk::Tickets.redact_attachments(client, ticket)
868
868
  # pp redaction
869
869
  # # => true
870
870
  def self.redact_attachments(client, ticket)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_support_readiness
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.36
4
+ version: 1.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Colyer