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,241 @@
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 GlobalIRHackeroneLicense within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class GlobalIROEMLicense < Readiness::Client
13
+ ##
14
+ # Process a Global Internal Request OEM License 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
+ unless zd_user.tags.include? 'oem_management_team'
25
+ Readiness::SupportSuperFormProcessor::Shared.not_oem_member(requester_email)
26
+ end
27
+ ticket = Readiness::Zendesk::Tickets.new
28
+ ticket.email_cc_ids = [zd_user.id]
29
+ ticket.requester_id = 379855863520
30
+ ticket.submitter_id = 379855863520
31
+ ticket.comment = { html_body: body }
32
+ ticket.subject = 'Internal Request - SM - OEM License'
33
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_oem_license]
34
+ ticket.priority = request_priority
35
+ ticket.status = 'new'
36
+ ticket.ticket_form_id = 360000071293
37
+ ticket.custom_fields = [
38
+ { id: 4414446722578, value: 'ticket_group_not_applicable' },
39
+ { id: 360020614420, value: 'aof_lnr' },
40
+ { id: 360020735259, value: 'stage-frt' },
41
+ { id: 360018253094, value: 'all_regions' },
42
+ { id: 360004394559, value: 'free_plan' },
43
+ { id: 360005183820, value: zd_user.name },
44
+ { id: 360005248219, value: zd_user.email },
45
+ { id: 360020735319, value: 'sev3' },
46
+ { id: 360020288373, value: '0' },
47
+ { id: 360014776453, value: 'medium' },
48
+ { id: 6978426204828, value: 'ir_oem' },
49
+ { id: 6978366086428, value: zd_user.email },
50
+ { id: 45195248, value: 'created_by_agent' }
51
+ ]
52
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
53
+ puts "Ticket created: https://gitlab.zendesk.com/agent/tickets/#{create.id}"
54
+ end
55
+
56
+ ##
57
+ # Sets the global variable requester
58
+ #
59
+ # @author Jason Colyer
60
+ # @since 1.0.42
61
+ def self.requester
62
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
63
+ end
64
+
65
+ ##
66
+ # Sets the global variable zd_user
67
+ #
68
+ # @author Jason Colyer
69
+ # @since 1.0.42
70
+ def self.zd_user
71
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
72
+ end
73
+
74
+ ##
75
+ # Sets the global variable requester_email
76
+ #
77
+ # @author Jason Colyer
78
+ # @since 1.0.42
79
+ def self.requester_email
80
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
81
+ end
82
+
83
+ def self.request_priority
84
+ @request_priority ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_PRIORITY')
85
+ end
86
+
87
+ ##
88
+ # Sets the global variable partner
89
+ #
90
+ # @author Jason Colyer
91
+ # @since 1.0.42
92
+ def self.partner
93
+ @partner ||= ENV.fetch('OEM_LICENSE_PARTNER')
94
+ end
95
+
96
+ ##
97
+ # Sets the global variable company
98
+ #
99
+ # @author Jason Colyer
100
+ # @since 1.0.42
101
+ def self.company
102
+ @company ||= ENV.fetch('OEM_LICENSE_COMPANY_NAME')
103
+ end
104
+
105
+ ##
106
+ # Sets the global variable previous_email
107
+ #
108
+ # @author Jason Colyer
109
+ # @since 1.0.42
110
+ def self.previous_email
111
+ @previous_email ||= ENV.fetch('OEM_LICENSE_SENT_TO')
112
+ end
113
+
114
+ ##
115
+ # Sets the global variable opportunity
116
+ #
117
+ # @author Jason Colyer
118
+ # @since 1.0.42
119
+ def self.opportunity
120
+ @opportunity ||= ENV.fetch('OEM_LICENSE_SFDC_OPPORTUNITY')
121
+ end
122
+
123
+ ##
124
+ # Sets the global variable license
125
+ #
126
+ # @author Jason Colyer
127
+ # @since 1.0.42
128
+ def self.license
129
+ @license ||= ENV.fetch('OEM_LICENSE_PREVIOUS_LICENSE')
130
+ end
131
+
132
+ ##
133
+ # Sets the global variable start_date
134
+ #
135
+ # @author Jason Colyer
136
+ # @since 1.0.42
137
+ def self.start_date
138
+ @start_date ||= ENV.fetch('OEM_LICENSE_START_DATE')
139
+ end
140
+
141
+ ##
142
+ # Sets the global variable end_date
143
+ #
144
+ # @author Jason Colyer
145
+ # @since 1.0.42
146
+ def self.end_date
147
+ @end_date ||= ENV.fetch('OEM_LICENSE_END_DATE')
148
+ end
149
+
150
+ ##
151
+ # Sets the global variable current_count
152
+ #
153
+ # @author Jason Colyer
154
+ # @since 1.0.42
155
+ def self.current_count
156
+ @current_count ||= ENV.fetch('OEM_LICENSE_SEATS')
157
+ end
158
+
159
+ ##
160
+ # Sets the global variable previous_count
161
+ #
162
+ # @author Jason Colyer
163
+ # @since 1.0.42
164
+ def self.previous_count
165
+ @previous_count ||= ENV.fetch('OEM_LICENSE_PREVIOUS')
166
+ end
167
+
168
+ ##
169
+ # Sets the global variable trueup
170
+ #
171
+ # @author Jason Colyer
172
+ # @since 1.0.42
173
+ def self.trueup
174
+ @trueup ||= ENV.fetch('OEM_LICENSE_TRUEUPS')
175
+ end
176
+
177
+ ##
178
+ # Sets the global variable sfdc_account_link
179
+ #
180
+ # @author Jason Colyer
181
+ # @since 1.0.42
182
+ def self.sfdc_account_link
183
+ @sfdc_account_link ||= ENV.fetch('OEM_LICENSE_SFDC_ACCOUNT')
184
+ end
185
+
186
+ ##
187
+ # Sets the global variable context
188
+ #
189
+ # @author Jason Colyer
190
+ # @since 1.0.42
191
+ def self.context
192
+ @context ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_CONTEXT')
193
+ end
194
+
195
+ ##
196
+ # Returns the ticket body
197
+ #
198
+ # @author Jason Colyer
199
+ # @since 1.0.42
200
+ # @return [String]
201
+ def self.body
202
+ <<~STRING
203
+ <p>
204
+ Greetings
205
+ </p>
206
+ <p>
207
+ 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.
208
+ </p>
209
+ <p>
210
+ A request has been filed for OEM License.
211
+ </p>
212
+ <p>
213
+ The information for this is as follows:
214
+ </p>
215
+ <ul>
216
+ <li>Company name: #{company}</li>
217
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(opportunity)}</li>
218
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account_link)}</li>
219
+ <li>
220
+ Previous license sent to: <a href='mailto:#{previous_email}'>#{previous_email}</a>
221
+ <a href="https://www.zuora.com/platform/apps/search?searchTerm=#{previous_email}" target='_blank'>(Zuora Search)</a>
222
+ <a href="https://customers.gitlab.com/admin/customer?model_name=customer&query=#{previous_email}" target='_blank'>(Portal Search)</a>
223
+ </li>
224
+ <li>Previous License: <a href='#{license}' target='_blank'>#{license}</a></li>
225
+ <li>Start date: #{start_date}</li>
226
+ <li>End date: #{end_date}</li>
227
+ <li>Current user count: #{current_count}</li>
228
+ <li>Previous user count: #{previous_count}</li>
229
+ <li>True-up count: #{trueup}</li>
230
+ </ul>
231
+ <p>
232
+ Some additional context for this request is:
233
+ </p>
234
+ <pre>
235
+ #{context}
236
+ </pre>
237
+ STRING
238
+ end
239
+ end
240
+ end
241
+ end
@@ -0,0 +1,267 @@
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 GlobalIROrderManagement within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class GlobalIROrderManagement < Readiness::Client
13
+ ##
14
+ # Process a Global Internal Request OEM License 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
+ unless zd_user.tags.include? 'order_management_team'
25
+ Readiness::SupportSuperFormProcessor::Shared.not_order_management_member(requester_email)
26
+ end
27
+ ticket = Readiness::Zendesk::Tickets.new
28
+ ticket.email_cc_ids = [zd_user.id]
29
+ ticket.requester_id = 379855863520
30
+ ticket.submitter_id = 379855863520
31
+ ticket.comment = { html_body: body }
32
+ ticket.subject = 'Internal Request - SM - Order Management'
33
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_order_management]
34
+ ticket.priority = request_priority
35
+ ticket.status = 'new'
36
+ ticket.ticket_form_id = 360000071293
37
+ ticket.custom_fields = [
38
+ { id: 4414446722578, value: 'ticket_group_not_applicable' },
39
+ { id: 360020614420, value: 'aof_lnr' },
40
+ { id: 360020735259, value: 'stage-frt' },
41
+ { id: 360018253094, value: 'all_regions' },
42
+ { id: 360004394559, value: 'free_plan' },
43
+ { id: 360005183820, value: zd_user.name },
44
+ { id: 360005248219, value: zd_user.email },
45
+ { id: 360020735319, value: 'sev3' },
46
+ { id: 360020288373, value: '0' },
47
+ { id: 360014776453, value: 'medium' },
48
+ { id: 6978426204828, value: 'ir_order_management' },
49
+ { id: 6978366086428, value: zd_user.email },
50
+ { id: 45195248, value: 'created_by_agent' }
51
+ ]
52
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
53
+ puts "Ticket created: https://gitlab.zendesk.com/agent/tickets/#{create.id}"
54
+ end
55
+
56
+ ##
57
+ # Sets the global variable requester
58
+ #
59
+ # @author Jason Colyer
60
+ # @since 1.0.42
61
+ def self.requester
62
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
63
+ end
64
+
65
+ ##
66
+ # Sets the global variable zd_user
67
+ #
68
+ # @author Jason Colyer
69
+ # @since 1.0.42
70
+ def self.zd_user
71
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
72
+ end
73
+
74
+ ##
75
+ # Sets the global variable requester_email
76
+ #
77
+ # @author Jason Colyer
78
+ # @since 1.0.42
79
+ def self.requester_email
80
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
81
+ end
82
+
83
+ ##
84
+ # Sets the global variable request_priority
85
+ #
86
+ # @author Jason Colyer
87
+ # @since 1.0.42
88
+ def self.request_priority
89
+ @request_priority ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_PRIORITY')
90
+ end
91
+
92
+ ##
93
+ # Sets the global variable context
94
+ #
95
+ # @author Jason Colyer
96
+ # @since 1.0.42
97
+ def self.context
98
+ @context ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_CONTEXT')
99
+ end
100
+
101
+ ##
102
+ # Sets the global variable contact_name
103
+ #
104
+ # @author Jason Colyer
105
+ # @since 1.0.42
106
+ def self.contact_name
107
+ @contact_name ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_CONTACT_NAME')
108
+ end
109
+
110
+ ##
111
+ # Sets the global variable contact_email
112
+ #
113
+ # @author Jason Colyer
114
+ # @since 1.0.42
115
+ def self.contact_email
116
+ @contact_email ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_EMAIL')
117
+ end
118
+
119
+ ##
120
+ # Sets the global variable company
121
+ #
122
+ # @author Jason Colyer
123
+ # @since 1.0.42
124
+ def self.company
125
+ @company ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_COMPANY_NAME')
126
+ end
127
+
128
+ ##
129
+ # Sets the global variable opp_link
130
+ #
131
+ # @author Jason Colyer
132
+ # @since 1.0.42
133
+ def self.opp_link
134
+ @opp_link ||= ENV.fetch('ORDER_MANAGEMENT_SFDC_OPPORTUNITY')
135
+ end
136
+
137
+ ##
138
+ # Sets the global variable sub_name
139
+ #
140
+ # @author Jason Colyer
141
+ # @since 1.0.42
142
+ def self.sub_name
143
+ @sub_name ||= ENV.fetch('ORDER_MANAGEMENT_SUB_NAME')
144
+ end
145
+
146
+ ##
147
+ # Sets the global variable sub_id
148
+ #
149
+ # @author Jason Colyer
150
+ # @since 1.0.42
151
+ def self.sub_id
152
+ @sub_id ||= ENV.fetch('ORDER_MANAGEMENT_ZUORA_ID')
153
+ end
154
+
155
+ ##
156
+ # Sets the global variable start_date
157
+ #
158
+ # @author Jason Colyer
159
+ # @since 1.0.42
160
+ def self.start_date
161
+ @start_date ||= ENV.fetch('ORDER_MANAGEMENT_START_DATE')
162
+ end
163
+
164
+ ##
165
+ # Sets the global variable end_date
166
+ #
167
+ # @author Jason Colyer
168
+ # @since 1.0.42
169
+ def self.end_date
170
+ @end_date ||= ENV.fetch('ORDER_MANAGEMENT_END_DATE')
171
+ end
172
+
173
+ ##
174
+ # Sets the global variable current
175
+ #
176
+ # @author Jason Colyer
177
+ # @since 1.0.42
178
+ def self.current
179
+ @current ||= ENV.fetch('ORDER_MANAGEMENT_SEATS')
180
+ end
181
+
182
+ ##
183
+ # Sets the global variable previous
184
+ #
185
+ # @author Jason Colyer
186
+ # @since 1.0.42
187
+ def self.previous
188
+ @previous ||= ENV.fetch('ORDER_MANAGEMENT_PREVIOUS')
189
+ end
190
+
191
+ ##
192
+ # Sets the global variable trueup
193
+ #
194
+ # @author Jason Colyer
195
+ # @since 1.0.42
196
+ def self.trueup
197
+ @trueup ||= ENV.fetch('ORDER_MANAGEMENT_TRUEUPS')
198
+ end
199
+
200
+ ##
201
+ # Sets the global variable sfdc_account_link
202
+ #
203
+ # @author Jason Colyer
204
+ # @since 1.0.42
205
+ def self.sfdc_account_link
206
+ @sfdc_account_link ||= ENV.fetch('ORDER_MANAGEMENT_SFDC_ACCOUNT')
207
+ end
208
+
209
+ ##
210
+ # Sets the global variable plan
211
+ #
212
+ # @author Jason Colyer
213
+ # @since 1.0.42
214
+ def self.plan
215
+ @plan ||= ENV.fetch('ORDER_MANAGEMENT_PLAN')
216
+ end
217
+
218
+ ##
219
+ # Returns the ticket body
220
+ #
221
+ # @author Jason Colyer
222
+ # @since 1.0.42
223
+ # @return [String]
224
+ def self.body
225
+ <<~STRING
226
+ <p>
227
+ Greetings,
228
+ </p>
229
+ <p>
230
+ 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.
231
+ </p>
232
+ <p>
233
+ A request has been filed for Order Management.
234
+ </p>
235
+ <p>
236
+ The information for this is as follows:
237
+ </p>
238
+ <ul>
239
+ <li>Contact's name: #{contact_name}</li>
240
+ <li>
241
+ Contact's email: #{contact_email}
242
+ <a href="https://www.zuora.com/platform/apps/search?searchTerm=#{contact_email}" target='_blank'>(Zuora Search)</a>
243
+ <a href="https://customers.gitlab.com/admin/customer?model_name=customer&query=#{contact_email}" target='_blank'>(Portal Search)</a>
244
+ </li>
245
+ <li>Contact's company: #{company}</li>
246
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(opp_link)}</li>
247
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account_link)}</li>
248
+ <li>Subscription name: #{sub_name}</li>
249
+ <li>Subscription ID: #{sub_id}</li>
250
+ <li>Start date: #{start_date}</li>
251
+ <li>End date: #{end_date}</li>
252
+ <li>User count: #{current}</li>
253
+ <li>Previous user count: #{previous}</li>
254
+ <li>True-up count: #{trueup}</li>
255
+ <li>Plan: #{plan}</li>
256
+ </ul>
257
+ <p>
258
+ Some additional context for this request is:
259
+ </p>
260
+ <pre>
261
+ #{context}
262
+ </pre>
263
+ STRING
264
+ end
265
+ end
266
+ end
267
+ end
@@ -0,0 +1,137 @@
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 GlobalIROther within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class GlobalIROther < Readiness::Client
13
+ ##
14
+ # Process a Global Internal Request Other 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 = 'Internal Request - Other (nothing else fits the request)'
30
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_internal_request_other]
31
+ ticket.priority = request_priority
32
+ ticket.status = 'new'
33
+ ticket.ticket_form_id = 360000071293
34
+ ticket.custom_fields = [
35
+ { id: 4414446722578, value: 'ticket_group_not_applicable' },
36
+ { id: 360020614420, value: 'aof_lnr' },
37
+ { id: 360020735259, value: 'stage-frt' },
38
+ { id: 360018253094, value: 'all_regions' },
39
+ { id: 360004394559, value: 'free_plan' },
40
+ { id: 360005183820, value: zd_user.name },
41
+ { id: 360005248219, value: zd_user.email },
42
+ { id: 360020735319, value: 'sev3' },
43
+ { id: 360020288373, value: '0' },
44
+ { id: 360014776453, value: 'medium' },
45
+ { id: 6978426204828, value: 'ir_other' },
46
+ { id: 6978366086428, value: zd_user.email },
47
+ { id: 45195248, value: 'created_by_agent' }
48
+ ]
49
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
50
+ puts "Ticket created: https://gitlab.zendesk.com/agent/tickets/#{create.id}"
51
+ end
52
+
53
+ ##
54
+ # Sets the global variable requester
55
+ #
56
+ # @author Jason Colyer
57
+ # @since 1.0.42
58
+ def self.requester
59
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
60
+ end
61
+
62
+ ##
63
+ # Sets the global variable zd_user
64
+ #
65
+ # @author Jason Colyer
66
+ # @since 1.0.42
67
+ def self.zd_user
68
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
69
+ end
70
+
71
+ ##
72
+ # Sets the global variable requester_email
73
+ #
74
+ # @author Jason Colyer
75
+ # @since 1.0.42
76
+ def self.requester_email
77
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
78
+ end
79
+
80
+ ##
81
+ # Sets the global variable request_priority
82
+ #
83
+ # @author Jason Colyer
84
+ # @since 1.0.42
85
+ def self.request_priority
86
+ @request_priority ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_PRIORITY')
87
+ end
88
+
89
+ ##
90
+ # Sets the global variable context
91
+ #
92
+ # @author Jason Colyer
93
+ # @since 1.0.42
94
+ def self.context
95
+ @context ||= ENV.fetch('INTERNAL_REQUEST_GLOBAL_CONTEXT')
96
+ end
97
+
98
+ ##
99
+ # Sets the global variable sfdc_account_link
100
+ #
101
+ # @author Jason Colyer
102
+ # @since 1.0.42
103
+ def self.sfdc_account_link
104
+ @sfdc_account_link ||= ENV.fetch('OTHER_SFDC_ACCOUNT')
105
+ end
106
+
107
+ ##
108
+ # Returns the ticket body
109
+ #
110
+ # @author Jason Colyer
111
+ # @since 1.0.42
112
+ # @return [String]
113
+ def self.body
114
+ <<~STRING
115
+ <p>
116
+ Greetings
117
+ </p>
118
+ <p>
119
+ 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.
120
+ </p>
121
+ <p>
122
+ A request has been filed for Other (nothing else fits the request).
123
+ </p>
124
+ <p>
125
+ #{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account_link)}
126
+ </p>
127
+ <p>
128
+ Some additional context for this request is:
129
+ </p>
130
+ <pre>
131
+ #{context}
132
+ </pre>
133
+ STRING
134
+ end
135
+ end
136
+ end
137
+ end