gitlab_support_readiness 1.0.43 → 1.0.44
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.
- checksums.yaml +4 -4
- data/lib/support_readiness/support_super_form_processor/global_set_collaboration_id.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/global_set_org_ase.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/global_toggle_escalation.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/gratis_support_extension.rb +23 -5
- data/lib/support_readiness/support_super_form_processor/gratis_support_former_customer.rb +31 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_migration.rb +31 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_other.rb +31 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_prospect.rb +31 -0
- data/lib/support_readiness/support_super_form_processor/gratis_support_upgrade.rb +31 -0
- data/lib/support_readiness/support_super_form_processor/namespace_availability.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/sa_request_for_support.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/usgov_set_collaboration_id.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb +1 -1
- data/lib/support_readiness/support_super_form_processor.rb +1 -0
- data/lib/support_readiness/ticket_processor/account_blocked.rb +289 -0
- data/lib/support_readiness/ticket_processor/email_suppressions.rb +135 -0
- data/lib/support_readiness/ticket_processor/link_tagger.rb +102 -0
- data/lib/support_readiness/ticket_processor/locked_account.rb +53 -0
- data/lib/support_readiness/ticket_processor/namesquatting.rb +223 -0
- data/lib/support_readiness/ticket_processor/organization_notes.rb +308 -0
- data/lib/support_readiness/ticket_processor/star.rb +32 -0
- data/lib/support_readiness/ticket_processor/weighting.rb +121 -0
- data/lib/support_readiness/ticket_processor.rb +19 -0
- data/lib/support_readiness.rb +1 -0
- metadata +11 -2
@@ -0,0 +1,308 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module TicketProcessor
|
6
|
+
module TicketProcessor
|
7
|
+
##
|
8
|
+
# Defines the class OrganizationNotes within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.44
|
12
|
+
class OrganizationNotes < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process an Organization Notes request for Zendesk Global
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.44
|
18
|
+
def self.process_global!(zendesk_client, gitlab_client, ticket_id)
|
19
|
+
@zendesk_client = zendesk_client
|
20
|
+
@gitlab_client = gitlab_client
|
21
|
+
@ticket_id = ticket_id
|
22
|
+
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
23
|
+
puts 'No ticket found, so no org notes to add' if @ticket.is_a? Hash
|
24
|
+
exit 0 if @ticket.is_a? Hash
|
25
|
+
|
26
|
+
puts 'Ticket is closed, so no org notes to add' if @ticket.status == 'closed'
|
27
|
+
exit 0 if @ticket.status == 'closed'
|
28
|
+
|
29
|
+
puts 'No organization, so no org notes to add' if @ticket.organization_id.nil?
|
30
|
+
exit 0 if @ticket.organization_id.nil?
|
31
|
+
|
32
|
+
@organization = Readiness::Zendesk::Organizations.find!(@zendesk_client, @ticket.organization_id)
|
33
|
+
@project = Readiness::GitLab::Projects.find!(@gitlab_client, 27675679)
|
34
|
+
file = Readiness::GitLab::Repositories.raw_file(@gitlab_client, @project, "organizations/#{@organization.id}.yaml", 'master')
|
35
|
+
yaml = YAML.safe_load(file)
|
36
|
+
@notes_file = if yaml['message']
|
37
|
+
create_notes_file
|
38
|
+
else
|
39
|
+
yaml
|
40
|
+
end
|
41
|
+
print 'Making organization info comment...'
|
42
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
43
|
+
new_ticket.id = @ticket.id
|
44
|
+
new_ticket.comment = { body: organization_info_comment.gsub("\n\n\n\n", "\n\n").strip, public: false }
|
45
|
+
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
46
|
+
puts 'done'
|
47
|
+
sleep 3
|
48
|
+
print 'Making organization entitlement info comment...'
|
49
|
+
new_ticket.comment = { body: organization_entitlement_comment.gsub("\n\n\n\n", "\n\n").strip, public: false }
|
50
|
+
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
51
|
+
puts 'done'
|
52
|
+
if @organization.organization_fields['sub_gitlab_dedicated']
|
53
|
+
sleep 3
|
54
|
+
print 'Making GitLab Dedicated note...'
|
55
|
+
new_ticket.comment = { body: gitlab_dedicated_comment.gsub("\n\n\n\n", "\n\n").strip, public: false }
|
56
|
+
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
57
|
+
puts 'done'
|
58
|
+
end
|
59
|
+
if @organization.organization_fields['support_level'] == 'Expired' && within_grace_period?
|
60
|
+
sleep 3
|
61
|
+
print 'Adding within_grace_period tag...'
|
62
|
+
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
63
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
64
|
+
new_ticket.id = @ticket.id
|
65
|
+
new_ticket.tags = @ticket.tags + ['within_grace_period']
|
66
|
+
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
67
|
+
puts 'done'
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.within_grace_period?
|
72
|
+
Date.today < grace_period
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.grace_period
|
76
|
+
Date.parse(@organization.organization_fields['expiration_date']) + 15.days
|
77
|
+
rescue TypeError
|
78
|
+
Date.parse('9999-12-31')
|
79
|
+
end
|
80
|
+
|
81
|
+
def self.determine_within_grace_period
|
82
|
+
Date.today < (Date.parse(@organization.organization_fields['expiration_date']) + 15.days)
|
83
|
+
rescue TypeError
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
def self.create_notes_file
|
88
|
+
puts 'no'
|
89
|
+
exit 1
|
90
|
+
content_string = "---\nid: #{@organization.idid}\nname: \"#{@organization.name}\"\nnotes:\ndetails:\n"
|
91
|
+
commit_params = {
|
92
|
+
branch: 'master',
|
93
|
+
commit_message: 'Creating default org note file',
|
94
|
+
actions: [
|
95
|
+
{
|
96
|
+
action: 'create',
|
97
|
+
file_path: "organizations/#{@organization.id}.yaml",
|
98
|
+
content: content_string
|
99
|
+
}
|
100
|
+
]
|
101
|
+
}
|
102
|
+
Readiness::GitLab::Repositories.create_commit!(@gitlab_client, @project, commit_params)
|
103
|
+
YAML.safe_load(content_string)
|
104
|
+
end
|
105
|
+
|
106
|
+
def self.organization_info_comment
|
107
|
+
<<~STRING
|
108
|
+
#{@organization.organization_fields['org_in_escalated_state'] ? escalated_string : ''}
|
109
|
+
## Organization Notes
|
110
|
+
|
111
|
+
#{@notes_file['notes']}
|
112
|
+
|
113
|
+
Manage this organization note via https://gitlab.com/gitlab-com/support/zendesk-global/organizations/-/blob/master/organizations/#{@organization.id}.yaml
|
114
|
+
|
115
|
+
#{partner_troubleshooting_string}
|
116
|
+
|
117
|
+
---
|
118
|
+
|
119
|
+
## Organization Info
|
120
|
+
|
121
|
+
- Account type: #{@organization.organization_fields['account_type'].to_s.capitalize}
|
122
|
+
- Sales Segmentation: #{@organization.organization_fields['sales_segmentation'].to_s.capitalize}
|
123
|
+
- Account Owner: #{@organization.organization_fields['account_owner']}
|
124
|
+
- Customer Success Manager: #{@organization.organization_fields['technical_account_manager']}
|
125
|
+
- Solutions Architect: #{@organization.organization_fields['solutions_architect']}
|
126
|
+
- Expiration/Next Renewal Date: #{@organization.organization_fields['expiration_date']}
|
127
|
+
- Salesforce: [#{@organization.organization_fields['salesforce_id']}](https://gitlab.lightning.force.com/lightning/r/Account/#{@organization.organization_fields['salesforce_id']}/view)
|
128
|
+
|
129
|
+
#{emergencies_list}
|
130
|
+
|
131
|
+
#{collab_project_string}
|
132
|
+
|
133
|
+
#{readiness_string}
|
134
|
+
STRING
|
135
|
+
end
|
136
|
+
|
137
|
+
def self.escalated_string
|
138
|
+
"---\n\n## NOTE: This organization is in an escalated state.\n\n"
|
139
|
+
end
|
140
|
+
|
141
|
+
def self.partner_troubleshooting_string
|
142
|
+
field = @ticket.custom_fields.detect { |t| t['id'] == 360012194220 }
|
143
|
+
return '' if field.nil?
|
144
|
+
return '' if field['value'].nil?
|
145
|
+
|
146
|
+
"---\n\n## Partner Troubleshooting\n\n#{field['value']}\n\n"
|
147
|
+
end
|
148
|
+
|
149
|
+
def self.emergencies_list
|
150
|
+
org_tickets = Readiness::Zendesk::Organizations.tickets(@zendesk_client, @organization)
|
151
|
+
list = org_tickets.select { |t| t.ticket_form_id == 360001264259 }
|
152
|
+
emergencies = list.reject { |t| t.id == @ticket.id }
|
153
|
+
return '' if emergencies.count.zero?
|
154
|
+
|
155
|
+
output = []
|
156
|
+
emergencies.each do |e|
|
157
|
+
string = "- [#{e.subject}](https://gitlab.zendesk.com/agent/tickets/#{e.id}) - created #{e.created_at}"
|
158
|
+
output.push(string)
|
159
|
+
end
|
160
|
+
<<~STRING
|
161
|
+
## Recent Emergencies
|
162
|
+
|
163
|
+
#{output.join("\n")}
|
164
|
+
STRING
|
165
|
+
end
|
166
|
+
|
167
|
+
def self.collab_project_string
|
168
|
+
return '' if @organization.organization_fields['am_project_id'].nil?
|
169
|
+
|
170
|
+
<<~STRING
|
171
|
+
---
|
172
|
+
|
173
|
+
## NOTE: This organization has an AM Collaboration project!
|
174
|
+
STRING
|
175
|
+
end
|
176
|
+
|
177
|
+
def self.readiness_string
|
178
|
+
output = [
|
179
|
+
cmp_string,
|
180
|
+
org_notes_string,
|
181
|
+
org_details_string,
|
182
|
+
shared_org_string
|
183
|
+
].compact
|
184
|
+
<<~STRING
|
185
|
+
#{output.join("\n\n")}
|
186
|
+
STRING
|
187
|
+
end
|
188
|
+
|
189
|
+
def self.cmp_string
|
190
|
+
return nil if @organization.organization_fields['cmp_id'].nil?
|
191
|
+
|
192
|
+
"#### This organization is using a contact management project!"
|
193
|
+
end
|
194
|
+
|
195
|
+
def self.org_notes_string
|
196
|
+
return nil if @organization.notes.to_s == ''
|
197
|
+
|
198
|
+
<<~STRING
|
199
|
+
#### Support Readiness Notes about this Organizations
|
200
|
+
|
201
|
+
#{@organization.notes}
|
202
|
+
STRING
|
203
|
+
end
|
204
|
+
|
205
|
+
def self.org_details_string
|
206
|
+
return nil if @organization.details.to_s == ''
|
207
|
+
|
208
|
+
<<~STRING
|
209
|
+
#### Support Readiness Details about this Organizations
|
210
|
+
|
211
|
+
#{@organization.details}
|
212
|
+
STRING
|
213
|
+
end
|
214
|
+
|
215
|
+
def self.shared_org_string
|
216
|
+
return nil unless @organization.shared_tickets
|
217
|
+
|
218
|
+
return "#### This organization has shared org permissions (read only)" unless @organization.shared_comments
|
219
|
+
|
220
|
+
"#### This organization has shared org permissions (read+write)"
|
221
|
+
end
|
222
|
+
|
223
|
+
def self.organization_entitlement_comment
|
224
|
+
return expired_message if @organization.organization_fields['support_level'] == 'Expired'
|
225
|
+
return prospect_message if @organization.tags.include? 'priority_prospect'
|
226
|
+
<<~STRING
|
227
|
+
#{subscriptions_message}
|
228
|
+
#{addons_message}
|
229
|
+
STRING
|
230
|
+
end
|
231
|
+
|
232
|
+
def self.expired_message
|
233
|
+
if within_grace_period?
|
234
|
+
if @organization.organization_fields['health_score'].to_s.capitalize == 'Green'
|
235
|
+
return "## NOTE: Within grace period (#{grace_period}) and health score is Green, provide support to the customer as usual."
|
236
|
+
elsif @organization.organization_fields['health_score'].to_s.capitalize == 'Yellow'
|
237
|
+
return "## NOTE: Within grace period (#{grace_period}) but health score is Yellow, reach out to their CSM/AM in [#account-management](https://gitlab.slack.com/archives/C44SXGG8M) and ask about this customer. In the meantime provide support to the customer as usual."
|
238
|
+
elsif @organization.organization_fields['health_score'].to_s.capitalize == 'Red'
|
239
|
+
return "## NOTE: Within grace period (#{grace_period}) but health score is Red, reach out to their CSM/AM in [#account-management](https://gitlab.slack.com/archives/C44SXGG8M) and ask about this customer. Do not provide support until they tell you to proceed."
|
240
|
+
else
|
241
|
+
return "## NOTE: Within grace period (#{grace_period}) but health score is unknown, contact CSM/AM in [#account-management](https://gitlab.slack.com/archives/C44SXGG8M) and ask about this customer. Do not provide support until they tell you to proceed."
|
242
|
+
end
|
243
|
+
end
|
244
|
+
'## NOTE: This account is showing as expired. Please confirm manually before proceeding!'
|
245
|
+
end
|
246
|
+
|
247
|
+
def self.prospect_message
|
248
|
+
'## NOTE: This is a priority prospect and is eligible for support.'
|
249
|
+
end
|
250
|
+
|
251
|
+
def self.subscriptions_message
|
252
|
+
subs = []
|
253
|
+
subs.push('Community (unidentified type)') if @organization.organization_fields['sub_community_other']
|
254
|
+
subs.push('GitLab.com Premium') if @organization.organization_fields['sub_dotcom_premium']
|
255
|
+
subs.push('GitLab.com Ultimate') if @organization.organization_fields['sub_dotcom_ultimate']
|
256
|
+
subs.push('Community (EDU)') if @organization.organization_fields['sub_edu']
|
257
|
+
subs.push('GitLab Dedicated') if @organization.organization_fields['sub_gitlab_dedicated']
|
258
|
+
subs.push('Community (OSS)') if @organization.organization_fields['sub_oss']
|
259
|
+
subs.push('Self-Managed Premium') if @organization.organization_fields['sub_sm_premium']
|
260
|
+
subs.push('Self-Managed Starter') if @organization.organization_fields['sub_sm_starter']
|
261
|
+
subs.push('Self-Managed Ultimate') if @organization.organization_fields['sub_sm_ultimate']
|
262
|
+
subs
|
263
|
+
return '' if subs.count.zero?
|
264
|
+
|
265
|
+
<<~STRING
|
266
|
+
## This organization has the following active subscription types:
|
267
|
+
|
268
|
+
#{subs.map { |s| "- #{s}" }.join("\n")}
|
269
|
+
STRING
|
270
|
+
end
|
271
|
+
|
272
|
+
def self.addons_message
|
273
|
+
addons = []
|
274
|
+
addons.push('AI') if @organization.organization_fields['sub_consumption_ai']
|
275
|
+
addons.push('GitLab Duo Premium') if @organization.organization_fields['sub_consumption_duo_premium']
|
276
|
+
addons.push('GitLab Duo Enterprise') if @organization.organization_fields['sub_consumption_duo_enterprise']
|
277
|
+
addons.push('AI addon') if @organization.organization_fields['sub_consumption_ai']
|
278
|
+
addons.push('Consumption (CI/CD Minutes)') if @organization.organization_fields['sub_consumption_cicd_minutes']
|
279
|
+
addons.push('Consumption (Storage)') if @organization.organization_fields['sub_consumption_storage']
|
280
|
+
addons.push('Enterprise Agile Planning') if @organization.organization_fields['sub_consumption_eap']
|
281
|
+
addons.push('Professional Services') if @organization.organization_fields['sub_proserv']
|
282
|
+
addons.push('Assigned Support Engineer') if @organization.organization_fields['sub_ss_ase']
|
283
|
+
addons
|
284
|
+
return '' if addons.count.zero?
|
285
|
+
|
286
|
+
<<~STRING
|
287
|
+
## This organization has the following active addons:
|
288
|
+
|
289
|
+
#{addons.map { |s| "- #{s}" }.join("\n")}
|
290
|
+
STRING
|
291
|
+
end
|
292
|
+
|
293
|
+
def self.gitlab_dedicated_comment
|
294
|
+
<<~STRING
|
295
|
+
## :information_source: Important Information about this Ticket
|
296
|
+
|
297
|
+
This is a [GitLab Dedicated](https://docs.gitlab.com/ee/subscriptions/gitlab_dedicated/) customer.
|
298
|
+
|
299
|
+
- **Logs**: :warning: Do **not** request GitLab logs from the customer.
|
300
|
+
- **Configuration**:
|
301
|
+
- Customers **can** access and make changes in the **Admin Area**.
|
302
|
+
- :warning: Do **not** request `gitlab.rb`, `values.yaml` or other GitLab configuration files from this customer.
|
303
|
+
- :question: Not sure what to do?: Check the [GitLab Dedicated Handbook](https://handbook.gitlab.com/handbook/support/workflows/dedicated_logs/) for information on how to handle :ticket: Dedicated tickets including information on [working with logs](https://handbook.gitlab.com/handbook/support/workflows/dedicated_logs/#working-with-logs).
|
304
|
+
STRING
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module TicketProcessor
|
6
|
+
module TicketProcessor
|
7
|
+
##
|
8
|
+
# Defines the class STAR within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.44
|
12
|
+
class STAR < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a STAR request
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.44
|
18
|
+
def self.process!(zendesk_client, ticket_id)
|
19
|
+
@zendesk_client = zendesk_client
|
20
|
+
@ticket_id = ticket_id
|
21
|
+
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
22
|
+
puts 'No ticket found, so no STAR actions to do' if @ticket.is_a? Hash
|
23
|
+
exit 0 if @ticket.is_a? Hash
|
24
|
+
|
25
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
26
|
+
new_ticket.id = @ticket.id
|
27
|
+
new_ticket.tags = @ticket.tags + ['star_submitted']
|
28
|
+
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
# Defines the module TicketProcessor
|
6
|
+
module TicketProcessor
|
7
|
+
##
|
8
|
+
# Defines the class Weighting within the module {Readiness::Zendesk}.
|
9
|
+
#
|
10
|
+
# @author Jason Colyer
|
11
|
+
# @since 1.0.44
|
12
|
+
class Weighting < Readiness::Client
|
13
|
+
##
|
14
|
+
# Process a Weighting request
|
15
|
+
#
|
16
|
+
# @author Jason Colyer
|
17
|
+
# @since 1.0.44
|
18
|
+
def self.process!(zendesk_client, ticket_id)
|
19
|
+
@zendesk_client = zendesk_client
|
20
|
+
@ticket_id = ticket_id
|
21
|
+
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
22
|
+
@organization = if @ticket.organization_id.nil?
|
23
|
+
nil
|
24
|
+
else
|
25
|
+
Readiness::Zendesk::Organizations.find!(@zendesk_client, @ticket.organization_id)
|
26
|
+
end
|
27
|
+
puts 'No ticket found, so no STAR actions to do' if @ticket.is_a? Hash
|
28
|
+
exit 0 if @ticket.is_a? Hash
|
29
|
+
|
30
|
+
time_diff = Time.parse('9999-12-31T23:59:59Z') - Time.parse(@ticket.created_at)
|
31
|
+
weight = calculate_weight
|
32
|
+
new_ticket = Readiness::Zendesk::Tickets.new
|
33
|
+
new_ticket.id = @ticket.id
|
34
|
+
new_ticket.custom_fields = [
|
35
|
+
{ id: 12508951067036, value: weight },
|
36
|
+
{ id: 13761175647260, value: "#{format('%03d', weight)} - #{format('%.5f', time_diff)}" }
|
37
|
+
]
|
38
|
+
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.calculate_weight
|
42
|
+
final = 0
|
43
|
+
final += arr_modifier unless @ticket.ticket_form_id == 360000071293
|
44
|
+
final += form_modifier unless @ticket.ticket_form_id == 360000071293
|
45
|
+
final += acc_type_modifier
|
46
|
+
final += ticket_priority_modifier
|
47
|
+
final += customer_priority_modifier
|
48
|
+
final += sla_breach_modifier
|
49
|
+
final
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.arr_modifier
|
53
|
+
arr = arr_to_use
|
54
|
+
return 17 if arr >= 1000000
|
55
|
+
return 12 if arr >= 300000
|
56
|
+
return 10 if arr >= 30000
|
57
|
+
return 8 if arr > 0
|
58
|
+
|
59
|
+
0
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.form_modifier
|
63
|
+
return 100 if @ticket.ticket_form_id == 360001264259
|
64
|
+
|
65
|
+
0
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.acc_type_modifier
|
69
|
+
return 0 if @organization.nil?
|
70
|
+
return 17 if @organization.organization_fields['account_type'] == 'alliance_partner'
|
71
|
+
return 10 if @organization.organization_fields['account_type'] == 'select_partner'
|
72
|
+
return 10 if @organization.organization_fields['account_type'] == 'open_partner'
|
73
|
+
|
74
|
+
0
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.ticket_priority_modifier
|
78
|
+
return 22 if @ticket.priority == 'urgent'
|
79
|
+
return 15 if @ticket.priority == 'high'
|
80
|
+
return 8 if @ticket.priority == 'medium'
|
81
|
+
|
82
|
+
2
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.customer_priority_modifier
|
86
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == 360014776453 }['value']
|
87
|
+
return 8 if field == 'urgent'
|
88
|
+
return 5 if field == 'high'
|
89
|
+
return 3 if field == 'medium'
|
90
|
+
|
91
|
+
1
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.sla_breach_modifier
|
95
|
+
breach_level = ENV.fetch('SLA_BREACH_LEVEL', 0).to_i
|
96
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == 360020735259 }['value']
|
97
|
+
return 19 if field == 'stage-frt' && breach_level == 1
|
98
|
+
return 38 if field == 'stage-frt' && breach_level == 2
|
99
|
+
return 57 if field == 'stage-frt' && breach_level == 3
|
100
|
+
return 9 if field == 'stage-nrt' && breach_level == 1
|
101
|
+
return 18 if field == 'stage-nrt' && breach_level == 2
|
102
|
+
return 27 if field == 'stage-nrt' && breach_level == 3
|
103
|
+
|
104
|
+
0
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.star_modifier
|
108
|
+
return 20 if @ticket.tags.include? 'star_submitted'
|
109
|
+
|
110
|
+
0
|
111
|
+
end
|
112
|
+
|
113
|
+
def self.arr_to_use
|
114
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == 360020288373 }['value'].to_f
|
115
|
+
return field if @organization.nil?
|
116
|
+
|
117
|
+
[field, @organization.organization_fields['aar'].to_f].max
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Defines the module Readiness.
|
4
|
+
module Readiness
|
5
|
+
##
|
6
|
+
# Defines the module TicketProcessor
|
7
|
+
# @author Jason Colyer
|
8
|
+
# @since 1.0.44
|
9
|
+
module TicketProcessor
|
10
|
+
require "#{__dir__}/ticket_processor/account_blocked"
|
11
|
+
require "#{__dir__}/ticket_processor/email_suppressions"
|
12
|
+
require "#{__dir__}/ticket_processor/link_tagger"
|
13
|
+
require "#{__dir__}/ticket_processor/locked_account"
|
14
|
+
require "#{__dir__}/ticket_processor/namesquatting"
|
15
|
+
require "#{__dir__}/ticket_processor/organization_notes"
|
16
|
+
require "#{__dir__}/ticket_processor/star"
|
17
|
+
require "#{__dir__}/ticket_processor/weighting"
|
18
|
+
end
|
19
|
+
end
|
data/lib/support_readiness.rb
CHANGED
@@ -43,4 +43,5 @@ require "#{__dir__}/support_readiness/repos"
|
|
43
43
|
require "#{__dir__}/support_readiness/salesforce"
|
44
44
|
require "#{__dir__}/support_readiness/slack"
|
45
45
|
require "#{__dir__}/support_readiness/support_super_form_processor"
|
46
|
+
require "#{__dir__}/support_readiness/ticket_processor"
|
46
47
|
require "#{__dir__}/support_readiness/zendesk"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_support_readiness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.44
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Colyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -372,6 +372,15 @@ files:
|
|
372
372
|
- lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_new.rb
|
373
373
|
- lib/support_readiness/support_super_form_processor/usgov_set_collaboration_id.rb
|
374
374
|
- lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb
|
375
|
+
- lib/support_readiness/ticket_processor.rb
|
376
|
+
- lib/support_readiness/ticket_processor/account_blocked.rb
|
377
|
+
- lib/support_readiness/ticket_processor/email_suppressions.rb
|
378
|
+
- lib/support_readiness/ticket_processor/link_tagger.rb
|
379
|
+
- lib/support_readiness/ticket_processor/locked_account.rb
|
380
|
+
- lib/support_readiness/ticket_processor/namesquatting.rb
|
381
|
+
- lib/support_readiness/ticket_processor/organization_notes.rb
|
382
|
+
- lib/support_readiness/ticket_processor/star.rb
|
383
|
+
- lib/support_readiness/ticket_processor/weighting.rb
|
375
384
|
- lib/support_readiness/zendesk.rb
|
376
385
|
- lib/support_readiness/zendesk/app_job_statuses.rb
|
377
386
|
- lib/support_readiness/zendesk/apps.rb
|