gitlab_support_readiness 1.0.142 → 1.1.0
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/salesforce/accounts.rb +82 -39
- data/lib/support_readiness/salesforce/client.rb +1 -0
- data/lib/support_readiness/support_super_form_processor/disable_us_government.rb +6 -2
- data/lib/support_readiness/support_super_form_processor/enable_us_government.rb +6 -2
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_billing_entity_change.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_extension.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_investigate.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_link.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_nfr.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_subscriptions_reset_seat_qsr.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_edit.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_extension.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_dotcom_trials_over_plan.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_hackerone_license.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_oem_license.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_order_management.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_other.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_did_not_receive.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_multiyear.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_nfr.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_resend.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_scl.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_subscriptions_temp.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_edit.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_extension.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_sm_trials_new.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_ir_wider_community_license.rb +33 -17
- data/lib/support_readiness/support_super_form_processor/global_set_org_ase.rb +1 -1
- data/lib/support_readiness/support_super_form_processor/gratis_request.rb +28 -14
- data/lib/support_readiness/support_super_form_processor/sa_request_for_support.rb +33 -16
- data/lib/support_readiness/support_super_form_processor/team_member_license.rb +6 -2
- data/lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_other.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_did_not_receive.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_multiyear.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_nfr.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_resend.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_scl.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_subs_temp.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_edit.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_extension.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_ir_sm_trials_new.rb +9 -4
- data/lib/support_readiness/support_super_form_processor/usgov_set_org_ase.rb +1 -1
- data/lib/support_readiness/ticket_processor/account_blocked.rb +18 -8
- data/lib/support_readiness/ticket_processor/email_suppressions.rb +7 -4
- data/lib/support_readiness/ticket_processor/locked_account.rb +3 -1
- data/lib/support_readiness/ticket_processor/namesquatting.rb +7 -5
- data/lib/support_readiness/ticket_processor/organization_notes.rb +10 -2
- data/lib/support_readiness/ticket_processor/weighting.rb +17 -8
- metadata +2 -2
@@ -19,6 +19,11 @@ module Readiness
|
|
19
19
|
@gitlab_client = gitlab_client
|
20
20
|
@gitlab_admin_client = gitlab_admin_client
|
21
21
|
@zendesk_client = zendesk_client
|
22
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
23
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
24
|
+
@license_issue_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'License Issue', @ticket_forms)
|
25
|
+
@ir_category_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Category', @ticket_fields)
|
26
|
+
@ir_submitter_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Submitter', @ticket_fields)
|
22
27
|
requester
|
23
28
|
zd_user
|
24
29
|
ticket = Readiness::Zendesk::Tickets.new
|
@@ -29,13 +34,13 @@ module Readiness
|
|
29
34
|
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_license lnr_sm_license_extension]
|
30
35
|
ticket.priority = 'normal'
|
31
36
|
ticket.status = 'new'
|
32
|
-
ticket.ticket_form_id =
|
37
|
+
ticket.ticket_form_id = @license_issue_form.id
|
33
38
|
ticket.custom_fields = [
|
34
|
-
{ id:
|
35
|
-
{ id:
|
39
|
+
{ id: @ir_category_field.id, value: 'ir_sm_temp' },
|
40
|
+
{ id: @ir_submitter_field.id, value: zd_user.email }
|
36
41
|
]
|
37
42
|
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
-
puts "Ticket created:
|
43
|
+
puts "Ticket created: #{create.id}"
|
39
44
|
end
|
40
45
|
|
41
46
|
##
|
@@ -19,6 +19,11 @@ module Readiness
|
|
19
19
|
@gitlab_client = gitlab_client
|
20
20
|
@gitlab_admin_client = gitlab_admin_client
|
21
21
|
@zendesk_client = zendesk_client
|
22
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
23
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
24
|
+
@license_issue_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'License Issue', @ticket_forms)
|
25
|
+
@ir_category_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Category', @ticket_fields)
|
26
|
+
@ir_submitter_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Submitter', @ticket_fields)
|
22
27
|
requester
|
23
28
|
zd_user
|
24
29
|
ticket = Readiness::Zendesk::Tickets.new
|
@@ -29,13 +34,13 @@ module Readiness
|
|
29
34
|
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_edit]
|
30
35
|
ticket.priority = 'normal'
|
31
36
|
ticket.status = 'new'
|
32
|
-
ticket.ticket_form_id =
|
37
|
+
ticket.ticket_form_id = @license_issue_form.id
|
33
38
|
ticket.custom_fields = [
|
34
|
-
{ id:
|
35
|
-
{ id:
|
39
|
+
{ id: @ir_category_field.id, value: 'ir_modify_sm_trial' },
|
40
|
+
{ id: @ir_submitter_field.id, value: zd_user.email }
|
36
41
|
]
|
37
42
|
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
-
puts "Ticket created:
|
43
|
+
puts "Ticket created: #{create.id}"
|
39
44
|
end
|
40
45
|
|
41
46
|
##
|
@@ -19,6 +19,11 @@ module Readiness
|
|
19
19
|
@gitlab_client = gitlab_client
|
20
20
|
@gitlab_admin_client = gitlab_admin_client
|
21
21
|
@zendesk_client = zendesk_client
|
22
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
23
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
24
|
+
@license_issue_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'License Issue', @ticket_forms)
|
25
|
+
@ir_category_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Category', @ticket_fields)
|
26
|
+
@ir_submitter_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Submitter', @ticket_fields)
|
22
27
|
requester
|
23
28
|
zd_user
|
24
29
|
ticket = Readiness::Zendesk::Tickets.new
|
@@ -29,13 +34,13 @@ module Readiness
|
|
29
34
|
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_extension]
|
30
35
|
ticket.priority = 'normal'
|
31
36
|
ticket.status = 'new'
|
32
|
-
ticket.ticket_form_id =
|
37
|
+
ticket.ticket_form_id = @license_issue_form.id
|
33
38
|
ticket.custom_fields = [
|
34
|
-
{ id:
|
35
|
-
{ id:
|
39
|
+
{ id: @ir_category_field.id, value: 'ir_extend_sm_trial' },
|
40
|
+
{ id: @ir_submitter_field.id, value: zd_user.email }
|
36
41
|
]
|
37
42
|
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
-
puts "Ticket created:
|
43
|
+
puts "Ticket created: #{create.id}"
|
39
44
|
end
|
40
45
|
|
41
46
|
##
|
@@ -19,6 +19,11 @@ module Readiness
|
|
19
19
|
@gitlab_client = gitlab_client
|
20
20
|
@gitlab_admin_client = gitlab_admin_client
|
21
21
|
@zendesk_client = zendesk_client
|
22
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
23
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
24
|
+
@license_issue_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'License Issue', @ticket_forms)
|
25
|
+
@ir_category_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Category', @ticket_fields)
|
26
|
+
@ir_submitter_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Submitter', @ticket_fields)
|
22
27
|
requester
|
23
28
|
zd_user
|
24
29
|
ticket = Readiness::Zendesk::Tickets.new
|
@@ -29,13 +34,13 @@ module Readiness
|
|
29
34
|
ticket.tags = %w[lnr_internal_request lnr_valid_request lnr_sm_trial lnr_sm_trial_new]
|
30
35
|
ticket.priority = 'normal'
|
31
36
|
ticket.status = 'new'
|
32
|
-
ticket.ticket_form_id =
|
37
|
+
ticket.ticket_form_id = @license_issue_form.id
|
33
38
|
ticket.custom_fields = [
|
34
|
-
{ id:
|
35
|
-
{ id:
|
39
|
+
{ id: @ir_category_field.id, value: 'ir_issues_sm_trial' },
|
40
|
+
{ id: @ir_submitter_field.id, value: zd_user.email }
|
36
41
|
]
|
37
42
|
create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket)
|
38
|
-
puts "Ticket created:
|
43
|
+
puts "Ticket created: #{create.id}"
|
39
44
|
end
|
40
45
|
|
41
46
|
##
|
@@ -109,7 +109,7 @@ module Readiness
|
|
109
109
|
return false if agent.is_a? Hash
|
110
110
|
return false if agent.role == 'end-user'
|
111
111
|
return false if agent.suspended
|
112
|
-
return false
|
112
|
+
return false unless [360008074111, 360009109092].include? agent.custom_role_id
|
113
113
|
|
114
114
|
true
|
115
115
|
end
|
@@ -15,7 +15,8 @@ module Readiness
|
|
15
15
|
#
|
16
16
|
# @author Jason Colyer
|
17
17
|
# @since 1.0.44
|
18
|
-
def self.process!(zendesk_client, gitlab_client, gitlab_admin_client, ticket_id)
|
18
|
+
def self.process!(zendesk_client, gitlab_client, gitlab_admin_client, ticket_id, sandbox_mode = false)
|
19
|
+
@sandbox_mode = sandbox_mode
|
19
20
|
@zendesk_client = zendesk_client
|
20
21
|
@gitlab_client = gitlab_client
|
21
22
|
@gitlab_admin_client = gitlab_admin_client
|
@@ -24,7 +25,10 @@ module Readiness
|
|
24
25
|
puts 'No ticket found, so nothing to autowork' if @ticket.is_a? Hash
|
25
26
|
exit 0 if @ticket.is_a? Hash
|
26
27
|
|
27
|
-
|
28
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
29
|
+
@impacted_email_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Impacted email address', @ticket_fields)
|
30
|
+
@ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields)
|
31
|
+
email = @ticket.custom_fields.detect { |t| t['id'] == @impacted_email_field.id }['value']
|
28
32
|
if email.to_s == ''
|
29
33
|
puts 'No email in the field, so nothing to autowork'
|
30
34
|
exit 0
|
@@ -39,7 +43,7 @@ module Readiness
|
|
39
43
|
new_ticket.status = 'pending'
|
40
44
|
new_ticket.comment = { body: no_user_comment(email) }
|
41
45
|
new_ticket.custom_fields = [
|
42
|
-
{ id:
|
46
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
43
47
|
]
|
44
48
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
45
49
|
puts 'done'
|
@@ -52,7 +56,7 @@ module Readiness
|
|
52
56
|
new_ticket.status = 'solved'
|
53
57
|
new_ticket.comment = { body: embargo_comment }
|
54
58
|
new_ticket.custom_fields = [
|
55
|
-
{ id:
|
59
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
56
60
|
]
|
57
61
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
58
62
|
puts 'done'
|
@@ -84,7 +88,7 @@ module Readiness
|
|
84
88
|
new_ticket.status = 'solved'
|
85
89
|
new_ticket.comment = { body: ps_block_removed_comment }
|
86
90
|
new_ticket.custom_fields = [
|
87
|
-
{ id:
|
91
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
88
92
|
]
|
89
93
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
90
94
|
puts 'done'
|
@@ -111,7 +115,7 @@ module Readiness
|
|
111
115
|
new_ticket.status = 'pending'
|
112
116
|
new_ticket.comment = { body: not_blocked_comment }
|
113
117
|
new_ticket.custom_fields = [
|
114
|
-
{ id:
|
118
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
115
119
|
]
|
116
120
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
117
121
|
puts 'done'
|
@@ -127,7 +131,7 @@ module Readiness
|
|
127
131
|
new_ticket.status = 'solved'
|
128
132
|
new_ticket.comment = { body: ps_block_rejected_comment }
|
129
133
|
new_ticket.custom_fields = [
|
130
|
-
{ id:
|
134
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
131
135
|
]
|
132
136
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
133
137
|
puts 'done'
|
@@ -242,7 +246,7 @@ module Readiness
|
|
242
246
|
|
243
247
|
| Related information | :link: |
|
244
248
|
| --------------------------------|--------|
|
245
|
-
| **Zendesk** |
|
249
|
+
| **Zendesk** | #{ticket_link} |
|
246
250
|
| **Account URL** | [Admin link](https://gitlab.com/admin/users/#{@user.username}) / [Profile link](https://gitlab.com/#{@user.username}) |
|
247
251
|
| **Project/Group/File** | |
|
248
252
|
| **Requestor email address**. | #{@user.email} |
|
@@ -263,6 +267,12 @@ module Readiness
|
|
263
267
|
STRING
|
264
268
|
end
|
265
269
|
|
270
|
+
def self.ticket_link
|
271
|
+
return "https://gitlab1707170878.zendesk.com/agent/tickets/#{@ticket.id}" unless @sandbox_mode
|
272
|
+
|
273
|
+
"https://gitlab.zendesk.com/agent/tickets/#{@ticket.id}"
|
274
|
+
end
|
275
|
+
|
266
276
|
def self.ps_block_rejected_comment
|
267
277
|
<<~STRING
|
268
278
|
Greetings,
|
@@ -26,7 +26,10 @@ module Readiness
|
|
26
26
|
puts 'Ticket is closed, so no org notes to add' if @ticket.status == 'closed'
|
27
27
|
exit 0 if @ticket.status == 'closed'
|
28
28
|
|
29
|
-
@
|
29
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
30
|
+
@impacted_email_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Impacted email address', @ticket_fields)
|
31
|
+
@ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields)
|
32
|
+
@email = @ticket.custom_fields.detect { |t| t['id'] == @impacted_email_field.id }['value']
|
30
33
|
return no_email_given if @email.nil?
|
31
34
|
|
32
35
|
bounce = Readiness::Mailgun::Bounces.find(@mailgun_client, @email)
|
@@ -43,7 +46,7 @@ module Readiness
|
|
43
46
|
new_ticket.status = 'solved'
|
44
47
|
new_ticket.comment = { body: suppression_removed_comment, public: true }
|
45
48
|
new_ticket.custom_fields = [
|
46
|
-
{ id:
|
49
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
47
50
|
]
|
48
51
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
49
52
|
end
|
@@ -54,7 +57,7 @@ module Readiness
|
|
54
57
|
new_ticket.id = @ticket.id
|
55
58
|
new_ticket.comment = { body: no_email_given_comment, public: false }
|
56
59
|
new_ticket.custom_fields = [
|
57
|
-
{ id:
|
60
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
58
61
|
]
|
59
62
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
60
63
|
end
|
@@ -65,7 +68,7 @@ module Readiness
|
|
65
68
|
new_ticket.status = 'pending'
|
66
69
|
new_ticket.comment = { body: no_bounce_exists_comment }
|
67
70
|
new_ticket.custom_fields = [
|
68
|
-
{ id:
|
71
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
69
72
|
]
|
70
73
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
71
74
|
end
|
@@ -25,12 +25,14 @@ module Readiness
|
|
25
25
|
puts 'Ticket is closed, so ticket to process' if @ticket.status == 'closed'
|
26
26
|
exit 0 if @ticket.status == 'closed'
|
27
27
|
|
28
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
29
|
+
@ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields)
|
28
30
|
new_ticket = Readiness::Zendesk::Tickets.new
|
29
31
|
new_ticket.id = @ticket.id
|
30
32
|
new_ticket.status = 'pending'
|
31
33
|
new_ticket.comment = { body: locked_account_comment }
|
32
34
|
new_ticket.custom_fields = [
|
33
|
-
{ id:
|
35
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
34
36
|
]
|
35
37
|
Readiness::Zendesk::Tickets.update!(zendesk_client, new_ticket)
|
36
38
|
end
|
@@ -26,6 +26,8 @@ module Readiness
|
|
26
26
|
puts 'Ticket is closed, so no org notes to add' if @ticket.status == 'closed'
|
27
27
|
exit 0 if @ticket.status == 'closed'
|
28
28
|
|
29
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
30
|
+
@ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields)
|
29
31
|
return not_for_free_users unless paid_tags.any? { |t| @ticket.tags.include? t }
|
30
32
|
return invalid_namespace unless Readiness::GitLab::Namespaces.exists?(@gitlab_admin_client, namespace_to_check)
|
31
33
|
return rejection_request if Readiness::GitLab::Namespaces.is_paid?(@gitlab_admin_client, namespace)
|
@@ -120,7 +122,7 @@ module Readiness
|
|
120
122
|
new_ticket.status = 'solved'
|
121
123
|
new_ticket.comment = { body: not_for_free_users_comment, public: true }
|
122
124
|
new_ticket.custom_fields = [
|
123
|
-
{ id:
|
125
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
124
126
|
]
|
125
127
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
126
128
|
end
|
@@ -131,7 +133,7 @@ module Readiness
|
|
131
133
|
new_ticket.status = 'solved'
|
132
134
|
new_ticket.comment = { body: invalid_namespace_comment, public: true }
|
133
135
|
new_ticket.custom_fields = [
|
134
|
-
{ id:
|
136
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
135
137
|
]
|
136
138
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
137
139
|
end
|
@@ -141,7 +143,7 @@ module Readiness
|
|
141
143
|
new_ticket.id = @ticket.id
|
142
144
|
new_ticket.comment = { body: immediate_release_comment, public: false }
|
143
145
|
new_ticket.custom_fields = [
|
144
|
-
{ id:
|
146
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
145
147
|
]
|
146
148
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
147
149
|
end
|
@@ -152,7 +154,7 @@ module Readiness
|
|
152
154
|
new_ticket.status = 'solved'
|
153
155
|
new_ticket.comment = { body: rejection_request_comment, public: true }
|
154
156
|
new_ticket.custom_fields = [
|
155
|
-
{ id:
|
157
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
156
158
|
]
|
157
159
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
158
160
|
end
|
@@ -162,7 +164,7 @@ module Readiness
|
|
162
164
|
new_ticket.id = @ticket.id
|
163
165
|
new_ticket.comment = { body: contact_owner_comment(owners), public: false }
|
164
166
|
new_ticket.custom_fields = [
|
165
|
-
{ id:
|
167
|
+
{ id: @ticket_stage_field.id, value: 'stage-frt' }
|
166
168
|
]
|
167
169
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
168
170
|
end
|
@@ -52,10 +52,11 @@ module Readiness
|
|
52
52
|
#
|
53
53
|
# @author Jason Colyer
|
54
54
|
# @since 1.0.44
|
55
|
-
def self.process_global!(zendesk_client, gitlab_client, ticket_id)
|
55
|
+
def self.process_global!(zendesk_client, gitlab_client, ticket_id, sandbox_mode = false)
|
56
56
|
@zendesk_client = zendesk_client
|
57
57
|
@gitlab_client = gitlab_client
|
58
58
|
@ticket_id = ticket_id
|
59
|
+
@sandbox_mode = sandbox_mode
|
59
60
|
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
60
61
|
puts 'No ticket found, so no org notes to add' if @ticket.is_a? Hash
|
61
62
|
exit 0 if @ticket.is_a? Hash
|
@@ -122,6 +123,8 @@ module Readiness
|
|
122
123
|
end
|
123
124
|
|
124
125
|
def self.create_notes_file
|
126
|
+
return nil if @sandbox_mode
|
127
|
+
|
125
128
|
content_string = "---\nid: #{@organization.id}\nname: \"#{@organization.name}\"\nnotes:\ndetails:\n"
|
126
129
|
commit_params = {
|
127
130
|
branch: 'master',
|
@@ -139,11 +142,16 @@ module Readiness
|
|
139
142
|
end
|
140
143
|
|
141
144
|
def self.organization_info_comment
|
145
|
+
if @sandbox_mode
|
146
|
+
note_file_contents = 'Being in the Sandbox, there is no organization notes file to use'
|
147
|
+
else
|
148
|
+
note_file_contents = @notes_file['notes']
|
149
|
+
end
|
142
150
|
<<~STRING
|
143
151
|
#{@organization.organization_fields['org_in_escalated_state'] ? escalated_string : ''}
|
144
152
|
## Organization Notes
|
145
153
|
|
146
|
-
#{
|
154
|
+
#{note_file_contents}
|
147
155
|
|
148
156
|
Manage this organization note via https://gitlab.com/gitlab-com/support/zendesk-global/organizations/-/blob/master/organizations/#{@organization.id}.yaml
|
149
157
|
|
@@ -18,6 +18,8 @@ module Readiness
|
|
18
18
|
def self.process!(zendesk_client, ticket_id)
|
19
19
|
@zendesk_client = zendesk_client
|
20
20
|
@ticket_id = ticket_id
|
21
|
+
@ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client)
|
22
|
+
@ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client)
|
21
23
|
@ticket = Readiness::Zendesk::Tickets.find(@zendesk_client, @ticket_id)
|
22
24
|
@organization = if @ticket.organization_id.nil?
|
23
25
|
nil
|
@@ -28,20 +30,27 @@ module Readiness
|
|
28
30
|
exit 0 if @ticket.is_a? Hash
|
29
31
|
|
30
32
|
time_diff = Time.parse('9999-12-31T23:59:59Z') - Time.parse(@ticket.created_at)
|
33
|
+
@ticket_weight_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Weight', @ticket_fields)
|
34
|
+
@ticket_weight_sorting_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Weight for Sorting', @ticket_fields)
|
35
|
+
@customer_priority_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Customer Priority', @ticket_fields)
|
36
|
+
@ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields)
|
37
|
+
@ticket_arr_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket ARR', @ticket_fields)
|
38
|
+
@lnr_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'L&R', @ticket_forms)
|
39
|
+
@emergency_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'Emergencies', @ticket_forms)
|
31
40
|
weight = calculate_weight
|
32
41
|
new_ticket = Readiness::Zendesk::Tickets.new
|
33
42
|
new_ticket.id = @ticket.id
|
34
43
|
new_ticket.custom_fields = [
|
35
|
-
{ id:
|
36
|
-
{ id:
|
44
|
+
{ id: @ticket_weight_field.id, value: weight },
|
45
|
+
{ id: @ticket_weight_sorting_field.id, value: "#{format('%03d', weight)} - #{format('%.5f', time_diff)}" }
|
37
46
|
]
|
38
47
|
Readiness::Zendesk::Tickets.update!(@zendesk_client, new_ticket)
|
39
48
|
end
|
40
49
|
|
41
50
|
def self.calculate_weight
|
42
51
|
final = 0
|
43
|
-
final += arr_modifier unless @ticket.ticket_form_id ==
|
44
|
-
final += form_modifier unless @ticket.ticket_form_id ==
|
52
|
+
final += arr_modifier unless @ticket.ticket_form_id == @lnr_form.id
|
53
|
+
final += form_modifier unless @ticket.ticket_form_id == @lnr_form.id
|
45
54
|
final += acc_type_modifier
|
46
55
|
final += ticket_priority_modifier
|
47
56
|
final += customer_priority_modifier
|
@@ -60,7 +69,7 @@ module Readiness
|
|
60
69
|
end
|
61
70
|
|
62
71
|
def self.form_modifier
|
63
|
-
return 100 if @ticket.ticket_form_id ==
|
72
|
+
return 100 if @ticket.ticket_form_id == @emergency_form.id
|
64
73
|
|
65
74
|
0
|
66
75
|
end
|
@@ -83,7 +92,7 @@ module Readiness
|
|
83
92
|
end
|
84
93
|
|
85
94
|
def self.customer_priority_modifier
|
86
|
-
field = @ticket.custom_fields.detect { |f| f['id'] ==
|
95
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == @customer_priority_field.id }['value']
|
87
96
|
return 8 if field == 'urgent'
|
88
97
|
return 5 if field == 'high'
|
89
98
|
return 3 if field == 'medium'
|
@@ -93,7 +102,7 @@ module Readiness
|
|
93
102
|
|
94
103
|
def self.sla_breach_modifier
|
95
104
|
breach_level = ENV.fetch('SLA_BREACH_LEVEL', 0).to_i
|
96
|
-
field = @ticket.custom_fields.detect { |f| f['id'] ==
|
105
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == @ticket_stage_field.id }['value']
|
97
106
|
return 19 if field == 'stage-frt' && breach_level == 1
|
98
107
|
return 38 if field == 'stage-frt' && breach_level == 2
|
99
108
|
return 57 if field == 'stage-frt' && breach_level == 3
|
@@ -111,7 +120,7 @@ module Readiness
|
|
111
120
|
end
|
112
121
|
|
113
122
|
def self.arr_to_use
|
114
|
-
field = @ticket.custom_fields.detect { |f| f['id'] ==
|
123
|
+
field = @ticket.custom_fields.detect { |f| f['id'] == @ticket_arr_field.id }['value'].to_f
|
115
124
|
return field if @organization.nil?
|
116
125
|
|
117
126
|
[field, @organization.organization_fields['aar'].to_f].max
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Colyer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|