gitlab_support_readiness 1.0.41 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/support_readiness/mailgun/client.rb +2 -1
  3. data/lib/support_readiness/mailgun/emails.rb +1 -1
  4. data/lib/support_readiness/support_super_form_processor/create_article.rb +375 -0
  5. data/lib/support_readiness/support_super_form_processor/create_macro.rb +183 -0
  6. data/lib/support_readiness/support_super_form_processor/edit_macro.rb +161 -0
  7. data/lib/support_readiness/support_super_form_processor/enable_us_government.rb +236 -0
  8. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_billing_entity_change.rb +218 -0
  9. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_extension.rb +238 -0
  10. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_investigate.rb +238 -0
  11. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_link.rb +213 -0
  12. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_nfr.rb +224 -0
  13. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_reset_seat_qsr.rb +194 -0
  14. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_edit.rb +198 -0
  15. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_extension.rb +228 -0
  16. data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_over_plan.rb +219 -0
  17. data/lib/support_readiness/support_super_form_processor/global_ir_hackerone_license.rb +172 -0
  18. data/lib/support_readiness/support_super_form_processor/global_ir_oem_license.rb +241 -0
  19. data/lib/support_readiness/support_super_form_processor/global_ir_order_management.rb +267 -0
  20. data/lib/support_readiness/support_super_form_processor/global_ir_other.rb +137 -0
  21. data/lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb +179 -0
  22. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_did_not_receive.rb +191 -0
  23. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_multiyear.rb +188 -0
  24. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_nfr.rb +215 -0
  25. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_resend.rb +188 -0
  26. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_scl.rb +194 -0
  27. data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_temp.rb +234 -0
  28. data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_edit.rb +203 -0
  29. data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_extension.rb +233 -0
  30. data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_new.rb +223 -0
  31. data/lib/support_readiness/support_super_form_processor/global_ir_wider_community_license.rb +247 -0
  32. data/lib/support_readiness/support_super_form_processor/global_set_collaboration_id.rb +151 -0
  33. data/lib/support_readiness/support_super_form_processor/global_set_org_ase.rb +293 -0
  34. data/lib/support_readiness/support_super_form_processor/global_toggle_escalation.rb +142 -0
  35. data/lib/support_readiness/support_super_form_processor/gratis_support_extension.rb +247 -0
  36. data/lib/support_readiness/support_super_form_processor/gratis_support_former_customer.rb +288 -0
  37. data/lib/support_readiness/support_super_form_processor/gratis_support_migration.rb +238 -0
  38. data/lib/support_readiness/support_super_form_processor/gratis_support_other.rb +221 -0
  39. data/lib/support_readiness/support_super_form_processor/gratis_support_prospect.rb +288 -0
  40. data/lib/support_readiness/support_super_form_processor/gratis_support_upgrade.rb +298 -0
  41. data/lib/support_readiness/support_super_form_processor/namespace_availability.rb +213 -0
  42. data/lib/support_readiness/support_super_form_processor/pd_shadow_modification.rb +189 -0
  43. data/lib/support_readiness/support_super_form_processor/sa_request_for_support.rb +214 -0
  44. data/lib/support_readiness/support_super_form_processor/shared.rb +518 -0
  45. data/lib/support_readiness/support_super_form_processor/team_member_license.rb +144 -0
  46. data/lib/support_readiness/support_super_form_processor/two_fa_exemption.rb +260 -0
  47. data/lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb +252 -0
  48. data/lib/support_readiness/support_super_form_processor/usgov_ir_other.rb +136 -0
  49. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_did_not_receive.rb +162 -0
  50. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_multiyear.rb +159 -0
  51. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_nfr.rb +196 -0
  52. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_resend.rb +159 -0
  53. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_scl.rb +160 -0
  54. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_temp.rb +219 -0
  55. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_edit.rb +189 -0
  56. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_extension.rb +219 -0
  57. data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_new.rb +209 -0
  58. data/lib/support_readiness/support_super_form_processor/usgov_set_collaboration_id.rb +151 -0
  59. data/lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb +295 -0
  60. data/lib/support_readiness/support_super_form_processor.rb +67 -0
  61. data/lib/support_readiness.rb +1 -0
  62. metadata +59 -2
@@ -0,0 +1,214 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Defines the module Readiness.
4
+ module Readiness
5
+ # Defines the module SupportSuperFormProcessor
6
+ module SupportSuperFormProcessor
7
+ ##
8
+ # Defines the class SARequestForSupport within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class SARequestForSupport < Readiness::Client
13
+ ##
14
+ # Process a SA Request for Support request
15
+ #
16
+ # @author Jason Colyer
17
+ # @since 1.0.42
18
+ def self.process!(gitlab_client, gitlab_admin_client, zendesk_client)
19
+ @gitlab_client = gitlab_client
20
+ @gitlab_admin_client = gitlab_admin_client
21
+ @zendesk_client = zendesk_client
22
+ requester
23
+ zd_user
24
+ ticket = Readiness::Zendesk::Tickets.new
25
+ ticket.email_cc_ids = [zd_user.id]
26
+ ticket.requester_id = 379855863520
27
+ ticket.submitter_id = 379855863520
28
+ ticket.comment = { html_body: body }
29
+ ticket.subject = 'Support Internal Request - SA - Request for Support'
30
+ ticket.tags = %w[support_internal_request support_valid_request support_ir_sa_request_for_support]
31
+ ticket.priority = request_priority
32
+ ticket.status = 'new'
33
+ ticket.ticket_form_id = 12829030177948
34
+ ticket.custom_fields = [
35
+ { id: 4414446722578, value: '' },
36
+ { id: 360020614420, value: 'aof_other' },
37
+ { id: 360020735259, value: 'stage-frt' },
38
+ { id: 360018253094, value: region_string },
39
+ { id: 360004394559, value: 'free_plan' },
40
+ { id: 360005183820, value: zd_user.name },
41
+ { id: 360005248219, value: zd_user.email },
42
+ { id: 360020735319, value: severity },
43
+ { id: 360020288373, value: '0' },
44
+ { id: 360014776453, value: request_priority },
45
+ { id: 45195248, value: 'created_by_agent' }
46
+ ]
47
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
48
+ puts "Ticket created: https://gitlab.zendesk.com/agent/tickets/#{create.id}"
49
+ end
50
+
51
+ ##
52
+ # Sets the global variable requester
53
+ #
54
+ # @author Jason Colyer
55
+ # @since 1.0.42
56
+ def self.requester
57
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
58
+ end
59
+
60
+ ##
61
+ # Sets the global variable zd_user
62
+ #
63
+ # @author Jason Colyer
64
+ # @since 1.0.42
65
+ def self.zd_user
66
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
67
+ end
68
+
69
+ ##
70
+ # Sets the global variable requester_email
71
+ #
72
+ # @author Jason Colyer
73
+ # @since 1.0.42
74
+ def self.requester_email
75
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
76
+ end
77
+
78
+ ##
79
+ # Return the string to use for the region field
80
+ #
81
+ # @author Jason Colyer
82
+ # @since 1.0.42
83
+ def self.region_string
84
+ case region
85
+ when 'AMER'
86
+ 'americas__usa'
87
+ when 'APAC'
88
+ 'asia_pacific'
89
+ when 'EMEA'
90
+ 'europe__middle_east__africa'
91
+ else
92
+ 'all_regions'
93
+ end
94
+ end
95
+
96
+ ##
97
+ # Return the string to use for the severity field
98
+ #
99
+ # @author Jason Colyer
100
+ # @since 1.0.42
101
+ def self.severity
102
+ case request_priority
103
+ when 'urgent'
104
+ 'sev1'
105
+ when 'high'
106
+ 'sev2'
107
+ when 'medium'
108
+ 'sev3'
109
+ when 'low'
110
+ 'sev4'
111
+ end
112
+ end
113
+
114
+ ##
115
+ # Sets the global variable request_priority
116
+ #
117
+ # @author Jason Colyer
118
+ # @since 1.0.42
119
+ def self.request_priority
120
+ @request_priority ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_URGENCY')
121
+ end
122
+
123
+ ##
124
+ # Sets the global variable region
125
+ #
126
+ # @author Jason Colyer
127
+ # @since 1.0.42
128
+ def self.region
129
+ @region ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_REGION')
130
+ end
131
+
132
+ ##
133
+ # Sets the global variable slack_url
134
+ #
135
+ # @author Jason Colyer
136
+ # @since 1.0.42
137
+ def self.slack_url
138
+ @slack_url ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_SLACK_URL')
139
+ end
140
+
141
+ ##
142
+ # Sets the global variable expectations
143
+ #
144
+ # @author Jason Colyer
145
+ # @since 1.0.42
146
+ def self.expectations
147
+ @expectations ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_EXPECTATION')
148
+ end
149
+
150
+ ##
151
+ # Sets the global variable sfdc_account
152
+ #
153
+ # @author Jason Colyer
154
+ # @since 1.0.42
155
+ def self.sfdc_account
156
+ @sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_SFDC_ACCOUNT')
157
+ end
158
+
159
+ ##
160
+ # Sets the global variable sfdc_opportunity
161
+ #
162
+ # @author Jason Colyer
163
+ # @since 1.0.42
164
+ def self.sfdc_opportunity
165
+ @sfdc_opportunity ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_SFDC_OPPORTUNITY')
166
+ end
167
+
168
+ ##
169
+ # Sets the global variable collab_project
170
+ #
171
+ # @author Jason Colyer
172
+ # @since 1.0.42
173
+ def self.collab_project
174
+ @collab_project ||= ENV.fetch('INTERNAL_REQUEST_SUPPORT_SA_COLLAB_PROJECT')
175
+ end
176
+
177
+ ##
178
+ # Return the ticket body
179
+ #
180
+ # @author Jason Colyer
181
+ # @since 1.0.42
182
+ def self.body
183
+ <<~STRING
184
+ <p>
185
+ Greetings
186
+ </p>
187
+ <p>
188
+ Please note that this is an <b>INTERNAL</b> ticket and should <b>NEVER</b> be shared with anyone. Please do not CC, BCC, forward, or anything else that can send the information from this ticket. <b>NEVER</b> add <i>anyone</i> outside of GitLab to this ticket or communications stemming from this ticket.
189
+ </p>
190
+ <p>
191
+ A SA has filed a request for assistance with Support.
192
+ </p>
193
+ <p>
194
+ The information for this is as follows:
195
+ </p>
196
+ <ul>
197
+ <li><a href='#{slack_url}' target='_blank'>Slack discussion</a>
198
+ <li>Preferred Region for Support: #{region}</li>
199
+ <li>Level of Urgency: #{request_priority}</li>
200
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
201
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(sfdc_opportunity)}</li>
202
+ <li>#{collab_project.empty? ? 'No collaboration project project' | "<a href='#{collab_project}' target='_blank'>Collaboration Project</a>"}</li>
203
+ </ul>
204
+ <p>
205
+ What is expected from Support?
206
+ </p>
207
+ <pre>
208
+ <%= @expectations %>
209
+ </pre>
210
+ STRING
211
+ end
212
+ end
213
+ end
214
+ end