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,219 @@
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 USGovIRSMTrialsExtension within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class USGovIRSMTrialsExtension < Readiness::Client
13
+ ##
14
+ # Process a US Government Internal Request Self-Managed Trials Extension 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 = 'Internal Request - SM - Extend an existing trial'
29
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_extension]
30
+ ticket.priority = 'normal'
31
+ ticket.status = 'new'
32
+ ticket.ticket_form_id = 360001803151
33
+ ticket.custom_fields = [
34
+ { id: 11717320292244, value: 'ir_extend_sm_trial' },
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_name
79
+ #
80
+ # @author Jason Colyer
81
+ # @since 1.0.42
82
+ def self.contact_name
83
+ @contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
84
+ end
85
+
86
+ ##
87
+ # Sets the global variable contact_email
88
+ #
89
+ # @author Jason Colyer
90
+ # @since 1.0.42
91
+ def self.contact_email
92
+ @contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
93
+ end
94
+
95
+ ##
96
+ # Sets the global variable company
97
+ #
98
+ # @author Jason Colyer
99
+ # @since 1.0.42
100
+ def self.company
101
+ @company ||= ENV.fetch('INTERNAL_REQUEST_USFED_COMPANY_NAME')
102
+ end
103
+
104
+ ##
105
+ # Sets the global variable license_link
106
+ #
107
+ # @author Jason Colyer
108
+ # @since 1.0.42
109
+ def self.license_link
110
+ @license_link ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_LICENSE')
111
+ end
112
+
113
+ ##
114
+ # Sets the global variable current
115
+ #
116
+ # @author Jason Colyer
117
+ # @since 1.0.42
118
+ def self.current
119
+ @current ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_USERS')
120
+ end
121
+
122
+ ##
123
+ # Sets the global variable plan
124
+ #
125
+ # @author Jason Colyer
126
+ # @since 1.0.42
127
+ def self.plan
128
+ @plan ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_PLAN')
129
+ end
130
+
131
+ ##
132
+ # Sets the global variable expiration
133
+ #
134
+ # @author Jason Colyer
135
+ # @since 1.0.42
136
+ def self.expiration
137
+ @expiration ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_CURRENT_EXPIRATION')
138
+ end
139
+
140
+ ##
141
+ # Sets the global variable extension_date
142
+ #
143
+ # @author Jason Colyer
144
+ # @since 1.0.42
145
+ def self.extension_date
146
+ @extension_date ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_NEW_EXPIRATION')
147
+ end
148
+
149
+ ##
150
+ # Sets the global variable reason
151
+ #
152
+ # @author Jason Colyer
153
+ # @since 1.0.42
154
+ def self.reason
155
+ @reason ||= ENV.fetch('USFED_SM_TRIAL_EXTEND_REASON')
156
+ end
157
+
158
+ ##
159
+ # Sets the global variable sfdc_account
160
+ #
161
+ # @author Jason Colyer
162
+ # @since 1.0.42
163
+ def self.sfdc_account
164
+ @sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
165
+ end
166
+
167
+ ##
168
+ # Sets the global variable version
169
+ #
170
+ # @author Jason Colyer
171
+ # @since 1.0.42
172
+ def self.version
173
+ @version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
174
+ end
175
+
176
+ ##
177
+ # Returns the ticket body
178
+ #
179
+ # @author Jason Colyer
180
+ # @since 1.0.42
181
+ # @return [String]
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 request has been filed for Extend an existing Self-managed trial.
192
+ </p>
193
+ <p>
194
+ The information for this is as follows:
195
+ </p>
196
+ <ul>
197
+ <li>Contact's name: #{contact_name}</li>
198
+ <li>Contact's email: #{contact_email}</li>
199
+ <li>Company: #{company}</li>
200
+ <li>Current license: #{license_link}</li>
201
+ <li>Current license expiration date: #{expiration}</li>
202
+ <li>Desired expiration date: #{extension_date}</li>
203
+ <li>User count: #{current}</li>
204
+ <li>Plan: #{plan}</li>
205
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
206
+ <li>Reason for extension: #{reason}</li>
207
+ <li>GitLab Version: #{version}</li>
208
+ </ul>
209
+ <p>
210
+ Some additional context for this request is:
211
+ </p>
212
+ <pre>
213
+ #{context}
214
+ </pre>
215
+ STRING
216
+ end
217
+ end
218
+ end
219
+ end
@@ -0,0 +1,209 @@
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 USGovIRSMTrialsNew within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class USGovIRSMTrialsNew < Readiness::Client
13
+ ##
14
+ # Process a US Government Internal Request Self-Managed Trials New 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 = 'Internal Request - SM - Problems starting a new trial'
29
+ ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_new]
30
+ ticket.priority = 'normal'
31
+ ticket.status = 'new'
32
+ ticket.ticket_form_id = 360001803151
33
+ ticket.custom_fields = [
34
+ { id: 11717320292244, value: 'ir_issues_sm_trial' },
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_name
79
+ #
80
+ # @author Jason Colyer
81
+ # @since 1.0.42
82
+ def self.contact_name
83
+ @contact_name ||= ENV.fetch('INTERNAL_REQUEST_USFED_CONTACT_NAME')
84
+ end
85
+
86
+ ##
87
+ # Sets the global variable contact_email
88
+ #
89
+ # @author Jason Colyer
90
+ # @since 1.0.42
91
+ def self.contact_email
92
+ @contact_email ||= ENV.fetch('INTERNAL_REQUEST_USFED_EMAIL')
93
+ end
94
+
95
+ ##
96
+ # Sets the global variable company
97
+ #
98
+ # @author Jason Colyer
99
+ # @since 1.0.42
100
+ def self.company
101
+ @company ||= ENV.fetch('INTERNAL_REQUEST_USFED_COMPANY_NAME')
102
+ end
103
+
104
+ ##
105
+ # Sets the global variable start_date
106
+ #
107
+ # @author Jason Colyer
108
+ # @since 1.0.42
109
+ def self.start_date
110
+ @start_date ||= ENV.fetch('USFED_SM_TRIAL_NEW_START_DATE')
111
+ end
112
+
113
+ ##
114
+ # Sets the global variable end_date
115
+ #
116
+ # @author Jason Colyer
117
+ # @since 1.0.42
118
+ def self.end_date
119
+ @end_date ||= ENV.fetch('USFED_SM_TRIAL_NEW_END_DATE')
120
+ end
121
+
122
+ ##
123
+ # Sets the global variable current
124
+ #
125
+ # @author Jason Colyer
126
+ # @since 1.0.42
127
+ def self.current
128
+ @current ||= ENV.fetch('USFED_SM_TRIAL_NEW_USERS')
129
+ end
130
+
131
+ ##
132
+ # Sets the global variable plan
133
+ #
134
+ # @author Jason Colyer
135
+ # @since 1.0.42
136
+ def self.plan
137
+ @plan ||= ENV.fetch('USFED_SM_TRIAL_NEW_PLAN')
138
+ end
139
+
140
+ ##
141
+ # Sets the global variable reason
142
+ #
143
+ # @author Jason Colyer
144
+ # @since 1.0.42
145
+ def self.reason
146
+ @reason ||= ENV.fetch('USFED_SM_TRIAL_NEW_REASON')
147
+ end
148
+
149
+ ##
150
+ # Sets the global variable sfdc_account
151
+ #
152
+ # @author Jason Colyer
153
+ # @since 1.0.42
154
+ def self.sfdc_account
155
+ @sfdc_account ||= ENV.fetch('INTERNAL_REQUEST_USFED_SFDC_ACCOUNT')
156
+ end
157
+
158
+ ##
159
+ # Sets the global variable version
160
+ #
161
+ # @author Jason Colyer
162
+ # @since 1.0.42
163
+ def self.version
164
+ @version ||= ENV.fetch('INTERNAL_REQUEST_USFED_VERSION')
165
+ end
166
+
167
+ ##
168
+ # Returns the ticket body
169
+ #
170
+ # @author Jason Colyer
171
+ # @since 1.0.42
172
+ # @return [String]
173
+ def self.body
174
+ <<~STRING
175
+ <p>
176
+ Greetings
177
+ </p>
178
+ <p>
179
+ 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.
180
+ </p>
181
+ <p>
182
+ A request has been filed for Problems starting a new Self-managed trial .
183
+ </p>
184
+ <p>
185
+ The information for this is as follows:
186
+ </p>
187
+ <ul>
188
+ <li>Contact's name: #{contact_name}</li>
189
+ <li>Contact's email: #{contact_email}</li>
190
+ <li>Company: #{company}</li>
191
+ <li>Trial start date: #{start_date}</li>
192
+ <li>Desired trial end date: #{end_date}</li>
193
+ <li>Trial seat count: #{current}</li>
194
+ <li>Trial plan: #{plan}</li>
195
+ <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li>
196
+ <li>Reason user cannot start a trial: #{reason}</li>
197
+ <li>GitLab Version: #{version}</li>
198
+ </ul>
199
+ <p>
200
+ Some additional context for this request is:
201
+ </p>
202
+ <pre>
203
+ #{context}
204
+ </pre>
205
+ STRING
206
+ end
207
+ end
208
+ end
209
+ end
@@ -0,0 +1,151 @@
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 USGovSetCollaboriationID within the module {Readiness::Zendesk}.
9
+ #
10
+ # @author Jason Colyer
11
+ # @since 1.0.42
12
+ class USGovSetCollaboriationID < Readiness::Client
13
+ ##
14
+ # Process setting a collab ID on a US Government organization
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.custom_fields = {
27
+ "am_project_id" => collaboriation_project_id
28
+ }
29
+ Readiness::Zendesk::Organizations.update!(@zendesk_client, new_org)
30
+ issue = Readiness::GitLab::Issues.new
31
+ issue.title = "Set the collaboration project ID for a Zendesk US Government organization - #{org.id}"
32
+ issue.description = message
33
+ create = Readiness::GitLab::Issues.create!(@gitlab_client, project, issue)
34
+ puts "Issue created: #{create.web_url}"
35
+ exit 0
36
+ end
37
+
38
+ ##
39
+ # Create issue when organization does not exist
40
+ #
41
+ # @author Jason Colyer
42
+ # @since 1.0.42
43
+ def self.org_does_not_exist
44
+ issue = Readiness::GitLab::Issues.new
45
+ issue.title = "Invalid Request - Organization Not Found"
46
+ issue.description = org_does_not_exist_message
47
+ create = Readiness::GitLab::Issues.create!(@gitlab_client, project, issue)
48
+ puts "Issue created: #{create.web_url}"
49
+ exit 0
50
+ end
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_USGOV_ORGANIZATION_ID')
95
+ end
96
+
97
+ ##
98
+ # Sets the global variable collaboriation_project_id
99
+ #
100
+ # @author Jason Colyer
101
+ # @since 1.0.42
102
+ def self.collaboriation_project_id
103
+ @collaboriation_project_id ||= ENV.fetch('ZENDESK_USGOV_ORGANIZATION_COLLAB_ID')
104
+ end
105
+
106
+ ##
107
+ # Returns the issue description
108
+ #
109
+ # @author Jason Colyer
110
+ # @since 1.0.42
111
+ def self.message
112
+ <<~STRING
113
+ ## Set the collaboration project ID for an Zendesk US Government organization - #{org.id}
114
+
115
+ Greetings @#{requester.username} !
116
+
117
+ We have set the collaboration project ID of the Zendesk US Government organization to that of #{collaboriation_project_id} at this time.
118
+
119
+ /label ~"AutomatedRequests::Set Org Collab ID"
120
+
121
+ /assign @#{requester.username}
122
+ STRING
123
+ end
124
+
125
+ ##
126
+ # Returns the issue description
127
+ #
128
+ # @author Jason Colyer
129
+ # @since 1.0.42
130
+ def self.org_does_not_exist_message
131
+ <<~STRING
132
+ ## Invalid Request Organization Not Found
133
+
134
+ Greetings @#{requester.username} !
135
+
136
+ We received a request from you recently, however the organization ID given #{org_id} is not a valid Zendesk US Government Organization ID. As such, we are not able to proceed.
137
+
138
+ Please review the Zendesk US Government organization you were wanting to use once more and file a new submission.
139
+
140
+ If you need assistance in locating the organization's ID, please ask in the Slack channel [#support_operations](https://gitlab.slack.com/archives/C018ZGZAMPD)
141
+
142
+ /label ~"AutomatedRequests::Invalid Organization"
143
+
144
+ /label ~"Invalid Zendesk US Government organization given"
145
+
146
+ /assign @#{requester.username}
147
+ STRING
148
+ end
149
+ end
150
+ end
151
+ end