gitlab_support_readiness 1.0.41 → 1.0.42

Sign up to get free protection for your applications and to get access to all the features.
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,260 @@
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 TwoFAExemption within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class TwoFAExemption < Readiness::Client
13
+ ##
14
+ # Process a 2FA Exemption 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
+ org_does_not_exist if org.is_a? Hash
24
+ new_org = Readiness::Zendesk::Organizations.new
25
+ new_org.id = org.id
26
+ new_org.tags = org.tags + ['skip_2fa_automation']
27
+ new_org.custom_fields = { "am_project_id" => collaboration_project_id }
28
+ Readiness::Zendesk::Organizations.update!(@zendesk_client, new_org)
29
+ issue = Readiness::GitLab::Issues.new
30
+ issue.title = "Enable 2FA Exemption for a large organization - #{org.id}"
31
+ issue.description = message
32
+ create = Readiness::GitLab::Issues.create!(@gitlab_client, project, issue)
33
+ puts "Issue created: #{create.web_url}"
34
+ exit 0
35
+ end
36
+
37
+ ##
38
+ # Create issue when organization does not exist
39
+ #
40
+ # @author Jason Colyer
41
+ # @since 1.0.42
42
+ def self.org_does_not_exist
43
+ issue = Readiness::GitLab::Issues.new
44
+ issue.title = "Invalid Request - Organization Not Found"
45
+ issue.description = org_does_not_exist_message
46
+ create = Readiness::GitLab::Issues.create!(@gitlab_client, project, issue)
47
+ puts "Issue created: #{create.web_url}"
48
+ exit 0
49
+ end
50
+
51
+
52
+ ##
53
+ # Sets the global variable requester
54
+ #
55
+ # @author Jason Colyer
56
+ # @since 1.0.42
57
+ def self.requester
58
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
59
+ end
60
+
61
+ ##
62
+ # Sets the global variable requester_email
63
+ #
64
+ # @author Jason Colyer
65
+ # @since 1.0.42
66
+ def self.requester_email
67
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
68
+ end
69
+
70
+ ##
71
+ # Sets the global variable project
72
+ #
73
+ # @author Jason Colyer
74
+ # @since 1.0.42
75
+ def self.project
76
+ @project ||= Readiness::GitLab::Projects.find!(@gitlab_client, 12811526)
77
+ end
78
+
79
+ ##
80
+ # Sets the global variable org
81
+ #
82
+ # @author Jason Colyer
83
+ # @since 1.0.42
84
+ def self.org
85
+ @org ||= Readiness::Zendesk::Organizations.find(@zendesk_client, org_id)
86
+ end
87
+
88
+ ##
89
+ # Sets the global variable org_id
90
+ #
91
+ # @author Jason Colyer
92
+ # @since 1.0.42
93
+ def self.org_id
94
+ @org_id ||= ENV.fetch('ZENDESK_ORGANIZATION_ID')
95
+ end
96
+
97
+ ##
98
+ # Sets the global variable slack_link
99
+ #
100
+ # @author Jason Colyer
101
+ # @since 1.0.42
102
+ def self.slack_link
103
+ @slack_link ||= ENV.fetch('ZENDESK_ORG_2FA_SLACK_LINK', nil)
104
+ end
105
+
106
+ ##
107
+ # Sets the global variable mfa_slack_user
108
+ #
109
+ # @author Jason Colyer
110
+ # @since 1.0.42
111
+ def self.mfa_slack_user
112
+ @mfa_slack_user ||= ENV.fetch('ZENDESK_ORG_2FA_SLACK_USER')
113
+ end
114
+
115
+ ##
116
+ # Sets the global variable mfa_gitlab_user
117
+ #
118
+ # @author Jason Colyer
119
+ # @since 1.0.42
120
+ def self.mfa_gitlab_user
121
+ @mfa_gitlab_user ||= ENV.fetch('ZENDESK_ORG_2FA_GITLAB_USER')
122
+ end
123
+
124
+ ##
125
+ # Sets the global variable collaboration_project_id
126
+ #
127
+ # @author Jason Colyer
128
+ # @since 1.0.42
129
+ def self.collaboration_project_id
130
+ @collaboration_project_id ||= ENV.fetch('ZENDESK_ORG_2FA_COLLAB_ID')
131
+ end
132
+
133
+ ##
134
+ # Returns the issue description
135
+ #
136
+ # @author Jason Colyer
137
+ # @since 1.0.42
138
+ def self.message
139
+ <<~STRING
140
+ ## Enable 2FA Exemption for a large organization - #{org.id}
141
+
142
+ Greetings @#{requester.username} !
143
+
144
+ We have set the required tag and collaboration project ID on the organization at this time.
145
+
146
+ Please note the required next steps that you will need to work on:
147
+
148
+ - [ ] You'll want to get assistance from support managers via the slack channel [#support_leadership](https://gitlab.enterprise.slack.com/archives/C01F9S37AKT) for adding the organization notes needed.
149
+ - For reference, the organization ID is #{org.id}, making the target note file https://gitlab.com/gitlab-com/support/zendesk-global/organizations/-/blob/master/organizations/#{org.id}.yaml?ref_type=heads
150
+ - Example org-note:
151
+ ```
152
+ This organization has access to the "Large Customer 2FA Workflow" (see [documentation](https://handbook.gitlab.com/handbook/support/workflows/account_verification/#large-customers))
153
+
154
+ [2FA Reset Template](link to template)
155
+ ```
156
+ - [ ] You'll want to ensure you've setup the issue template required in the collaboration project
157
+ - Ensure the filename is `2FA Verification.md`
158
+ - Ensure the file's location is within path `.gitlab/issue_templates`
159
+ - Ensure the file contents use the following template:
160
+
161
+ #{slack_link.nil? ? template_without_slack : template_with_slack}
162
+
163
+ /assign @#{requester.username}
164
+ STRING
165
+ end
166
+
167
+ ##
168
+ # Returns the template to use when no slack link is present
169
+ #
170
+ # @author Jason Colyer
171
+ # @since 1.0.42
172
+ def self.template_without_slack
173
+ <<~STRING
174
+ ```
175
+ A user in your organization is requesting to have [GitLab two-factor authentication](https://docs.gitlab.com/ee/user/profile/account/two_factor_authentication.html) removed from their account. Please review and complete the highlighted sections below.
176
+
177
+ **Support Engineer Instructions**
178
+
179
+ - Fill out the `Request Details` section below.
180
+
181
+ **Request Details**
182
+
183
+ - User Requesting Reset: USERS_GITLAB_USERNAME
184
+ - Support Ticket: TICKET_NUMBER
185
+
186
+ **Customer Instructions**
187
+
188
+ - Review the request and get in contact with the user requesting the reset to verify its authenticity.
189
+ - Comment on this issue indicating your approval.
190
+ - Unassign yourself and any others from this issue.
191
+ - Assign to the Support Engineer who opened this issue.
192
+
193
+ /assign @#{mfa_gitlab_user}
194
+
195
+ /label ~"2FA Reset" ~"Awaiting confirmation"
196
+ ```
197
+ STRING
198
+ end
199
+
200
+ ##
201
+ # Returns the template to use when a slack link is present
202
+ #
203
+ # @author Jason Colyer
204
+ # @since 1.0.42
205
+ def self.template_with_slack
206
+ <<~STRING
207
+ ```
208
+ A user in your organization is requesting to have [GitLab two-factor authentication](https://docs.gitlab.com/ee/user/profile/account/two_factor_authentication.html) removed from their account. Please review and complete the highlighted sections below.
209
+
210
+ **Support Engineer Instructions**
211
+
212
+ - Ping the customer’s organization owners in #{slack_link} using the [Notify Customer - Slack ](https://handbook.gitlab.com/handbook/support/workflows/account_verification#2-contact-through-slack) template. For this organization the owners are #{mfa_slack_user}.
213
+ - Fill out the `Request Details` section below.
214
+
215
+ **Request Details**
216
+
217
+ - User Requesting Reset: USERS_GITLAB_USERNAME
218
+ - Support Ticket: TICKET_NUMBER
219
+
220
+ **Customer Instructions**
221
+
222
+ - Review the request and get in contact with the user requesting the reset to verify its authenticity.
223
+ - Comment on this issue indicating your approval.
224
+ - Unassign yourself and any others from this issue.
225
+ - Assign to the Support Engineer who opened this issue.
226
+
227
+ /assign @#{mfa_gitlab_user}
228
+
229
+ /label ~"2FA Reset" ~"Awaiting confirmation"
230
+ ```
231
+ STRING
232
+ end
233
+
234
+ ##
235
+ # Returns the issue description
236
+ #
237
+ # @author Jason Colyer
238
+ # @since 1.0.42
239
+ def self.org_does_not_exist_message
240
+ <<~STRING
241
+ ## Invalid Request Organization Not Found
242
+
243
+ Greetings @#{requester.username} !
244
+
245
+ We received a request from you recently, however the organization ID given #{org_id} is not a valid Zendesk Global Organization ID. As such, we are not able to proceed.
246
+
247
+ Please review the Zendesk Global organization you were wanting to use once more and file a new submission.
248
+
249
+ If you need assistance in locating the organization's ID, please ask in the Slack channel [#support_operations](https://gitlab.slack.com/archives/C018ZGZAMPD)
250
+
251
+ /label ~"AutomatedRequests::Invalid Organization"
252
+
253
+ /label ~"Invalid Zendesk Global organization given"
254
+
255
+ /assign @#{requester.username}
256
+ STRING
257
+ end
258
+ end
259
+ end
260
+ end
@@ -0,0 +1,252 @@
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 USGovIRORderManagement within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class USGovIRORderManagement < Readiness::Client
13
+ ##
14
+ # Process a US Government Internal Request Order Management 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.requester_id = zd_user.id
29
+ ticket.submitter_id = zd_user.id
30
+ ticket.comment = { html_body: body }
31
+ ticket.subject = 'xxxxx'
32
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_order_management]
33
+ ticket.priority = 'normal'
34
+ ticket.status = 'new'
35
+ ticket.ticket_form_id = 360001803151
36
+ ticket.custom_fields = [
37
+ { id: 11717320292244, value: 'xxxxxxxxxxxxxxxxxxx' },
38
+ { id: 11717222771604, value: zd_user.email }
39
+ ]
40
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
41
+ puts "Ticket created: https://gitlab-federal-support.zendesk.com/agent/tickets/#{create.id}"
42
+ end
43
+
44
+ ##
45
+ # Sets the global variable requester
46
+ #
47
+ # @author Jason Colyer
48
+ # @since 1.0.42
49
+ def self.requester
50
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
51
+ end
52
+
53
+ ##
54
+ # Sets the global variable zd_user
55
+ #
56
+ # @author Jason Colyer
57
+ # @since 1.0.42
58
+ def self.zd_user
59
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
60
+ end
61
+
62
+ ##
63
+ # Sets the global variable requester_email
64
+ #
65
+ # @author Jason Colyer
66
+ # @since 1.0.42
67
+ def self.requester_email
68
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
69
+ end
70
+
71
+ ##
72
+ # Sets the global variable context
73
+ #
74
+ # @author Jason Colyer
75
+ # @since 1.0.42
76
+ def self.context
77
+ @context ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTEXT')
78
+ end
79
+
80
+ ##
81
+ # Sets the global variable contact_name
82
+ #
83
+ # @author Jason Colyer
84
+ # @since 1.0.42
85
+ def self.contact_name
86
+ @contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
87
+ end
88
+
89
+ ##
90
+ # Sets the global variable contact_email
91
+ #
92
+ # @author Jason Colyer
93
+ # @since 1.0.42
94
+ def self.contact_email
95
+ @contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
96
+ end
97
+
98
+ ##
99
+ # Sets the global variable company
100
+ #
101
+ # @author Jason Colyer
102
+ # @since 1.0.42
103
+ def self.company
104
+ @company ||= ENV.fetch('INTERNAL_REQUEST_USFED_COMPANY_NAME')
105
+ end
106
+
107
+ ##
108
+ # Sets the global variable opp_link
109
+ #
110
+ # @author Jason Colyer
111
+ # @since 1.0.42
112
+ def self.opp_link
113
+ @opp_link ||= ENV.fetch('USFED_ORDER_MANAGEMENT_SFDC_OPPORTUNITY')
114
+ end
115
+
116
+ ##
117
+ # Sets the global variable sub_name
118
+ #
119
+ # @author Jason Colyer
120
+ # @since 1.0.42
121
+ def self.sub_name
122
+ @sub_name ||= ENV.fetch('USFED_ORDER_MANAGEMENT_SUB_NAME')
123
+ end
124
+
125
+ ##
126
+ # Sets the global variable sub_id
127
+ #
128
+ # @author Jason Colyer
129
+ # @since 1.0.42
130
+ def self.sub_id
131
+ @sub_id ||= ENV.fetch('USFED_ORDER_MANAGEMENT_ZUORA_ID')
132
+ end
133
+
134
+ ##
135
+ # Sets the global variable start_date
136
+ #
137
+ # @author Jason Colyer
138
+ # @since 1.0.42
139
+ def self.start_date
140
+ @start_date ||= ENV.fetch('USFED_ORDER_MANAGEMENT_START_DATE')
141
+ end
142
+
143
+ ##
144
+ # Sets the global variable end_date
145
+ #
146
+ # @author Jason Colyer
147
+ # @since 1.0.42
148
+ def self.end_date
149
+ @end_date ||= ENV.fetch('USFED_ORDER_MANAGEMENT_END_DATE')
150
+ end
151
+
152
+ ##
153
+ # Sets the global variable current
154
+ #
155
+ # @author Jason Colyer
156
+ # @since 1.0.42
157
+ def self.current
158
+ @current ||= ENV.fetch('USFED_ORDER_MANAGEMENT_USERS')
159
+ end
160
+
161
+ ##
162
+ # Sets the global variable previous
163
+ #
164
+ # @author Jason Colyer
165
+ # @since 1.0.42
166
+ def self.previous
167
+ @previous ||= ENV.fetch('USFED_ORDER_MANAGEMENT_PREVIOUS')
168
+ end
169
+
170
+ ##
171
+ # Sets the global variable trueup
172
+ #
173
+ # @author Jason Colyer
174
+ # @since 1.0.42
175
+ def self.trueup
176
+ @trueup ||= ENV.fetch('USFED_ORDER_MANAGEMENT_TRUEUPS')
177
+ end
178
+
179
+ ##
180
+ # Sets the global variable plan
181
+ #
182
+ # @author Jason Colyer
183
+ # @since 1.0.42
184
+ def self.plan
185
+ @plan ||= ENV.fetch('USFED_ORDER_MANAGEMENT_PLAN')
186
+ end
187
+
188
+ ##
189
+ # Sets the global variable sfdc_account
190
+ #
191
+ # @author Jason Colyer
192
+ # @since 1.0.42
193
+ def self.sfdc_account
194
+ @sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
195
+ end
196
+
197
+ ##
198
+ # Sets the global variable version
199
+ #
200
+ # @author Jason Colyer
201
+ # @since 1.0.42
202
+ def self.version
203
+ @version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
204
+ end
205
+
206
+ ##
207
+ # Returns the ticket body
208
+ #
209
+ # @author Jason Colyer
210
+ # @since 1.0.42
211
+ # @return [String]
212
+ def self.body
213
+ <<~STRING
214
+ <p>
215
+ Greetings,
216
+ </p>
217
+ <p>
218
+ 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.
219
+ </p>
220
+ <p>
221
+ A request has been filed for Order Management.
222
+ </p>
223
+ <p>
224
+ The information for this is as follows:
225
+ </p>
226
+ <ul>
227
+ <li>Contact's name: #{contact_name}</li>
228
+ <li>Contact's email: #{contact_email}</li>
229
+ <li>Contact's company: #{company}</li>
230
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(opp_link)}</li>
231
+ <li>Subscription name: #{sub_name}</li>
232
+ <li>Subscription ID: #{sub_id}</li>
233
+ <li>Start date: #{start_date}</li>
234
+ <li>End date: #{end_date}</li>
235
+ <li>User count: #{current}</li>
236
+ <li>Previous user count: #{previous}</li>
237
+ <li>True-up count: #{trueup}</li>
238
+ <li>Plan: #{plan}</li>
239
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
240
+ <li>GitLab Version: #{version}</li>
241
+ </ul>
242
+ <p>
243
+ Some additional context for this request is:
244
+ </p>
245
+ <pre>
246
+ #{context}
247
+ </pre>
248
+ STRING
249
+ end
250
+ end
251
+ end
252
+ end
@@ -0,0 +1,136 @@
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 USGovIROther within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class USGovIROther < Readiness::Client
13
+ ##
14
+ # Process a US Government 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.requester_id = zd_user.id
26
+ ticket.submitter_id = zd_user.id
27
+ ticket.comment = { html_body: body }
28
+ ticket.subject = 'xxxxx'
29
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_internal_request_other]
30
+ ticket.priority = 'normal'
31
+ ticket.status = 'new'
32
+ ticket.ticket_form_id = 360001803151
33
+ ticket.custom_fields = [
34
+ { id: 11717320292244, value: 'ir_other' },
35
+ { id: 11717222771604, value: zd_user.email }
36
+ ]
37
+ create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
38
+ puts "Ticket created: https://gitlab-federal-support.zendesk.com/agent/tickets/#{create.id}"
39
+ end
40
+
41
+ ##
42
+ # Sets the global variable requester
43
+ #
44
+ # @author Jason Colyer
45
+ # @since 1.0.42
46
+ def self.requester
47
+ @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email)
48
+ end
49
+
50
+ ##
51
+ # Sets the global variable zd_user
52
+ #
53
+ # @author Jason Colyer
54
+ # @since 1.0.42
55
+ def self.zd_user
56
+ @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email)
57
+ end
58
+
59
+ ##
60
+ # Sets the global variable requester_email
61
+ #
62
+ # @author Jason Colyer
63
+ # @since 1.0.42
64
+ def self.requester_email
65
+ @requester_email ||= ENV.fetch('REQUESTER_EMAIL')
66
+ end
67
+
68
+ ##
69
+ # Sets the global variable context
70
+ #
71
+ # @author Jason Colyer
72
+ # @since 1.0.42
73
+ def self.context
74
+ @context ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTEXT')
75
+ end
76
+
77
+ ##
78
+ # Sets the global variable contact_email
79
+ #
80
+ # @author Jason Colyer
81
+ # @since 1.0.42
82
+ def self.contact_email
83
+ @contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
84
+ end
85
+
86
+ ##
87
+ # Sets the global variable sfdc_account
88
+ #
89
+ # @author Jason Colyer
90
+ # @since 1.0.42
91
+ def self.sfdc_account
92
+ @sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
93
+ end
94
+
95
+ ##
96
+ # Sets the global variable version
97
+ #
98
+ # @author Jason Colyer
99
+ # @since 1.0.42
100
+ def self.version
101
+ @version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
102
+ end
103
+
104
+ ##
105
+ # Returns the ticket body
106
+ #
107
+ # @author Jason Colyer
108
+ # @since 1.0.42
109
+ # @return [String]
110
+ def self.body
111
+ <<~STRING
112
+ <p>
113
+ Greetings
114
+ </p>
115
+ <p>
116
+ 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.
117
+ </p>
118
+ <p>
119
+ A request has been filed for Other (nothing else fits the request).
120
+ </p>
121
+ <ul>
122
+ <li>GitLab Version: #{version}</li>
123
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
124
+ <li>Contact email: #{contact_email}</li>
125
+ </ul>
126
+ <p>
127
+ Some additional context for this request is:
128
+ </p>
129
+ <pre>
130
+ #{context}
131
+ </pre>
132
+ STRING
133
+ end
134
+ end
135
+ end
136
+ end