Class: Readiness::SupportSuperFormProcessor::GlobalIRProvisionFailure
- Inherits:
-
Client
- Object
- Client
- Readiness::SupportSuperFormProcessor::GlobalIRProvisionFailure
- Defined in:
- lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb
Overview
Defines the class GlobalIRProvisionFailure within the module Zendesk.
Class Method Summary collapse
-
.body ⇒ String
Returns the ticket body.
-
.context ⇒ Object
Sets the global variable context.
-
.customer_link ⇒ Object
Sets the global variable customer_link.
-
.process!(gitlab_client, gitlab_admin_client, zendesk_client) ⇒ Object
Process a Global Internal Request Provision Failure request.
-
.provision_link ⇒ Object
Sets the global variable provision_link.
-
.provision_message ⇒ Object
Sets the global variable provision_message.
-
.request_priority ⇒ Object
Sets the global variable request_priority.
-
.requester ⇒ Object
Sets the global variable requester.
-
.requester_email ⇒ Object
Sets the global variable requester_email.
-
.zd_user ⇒ Object
Sets the global variable zd_user.
-
.zuora_sub_link ⇒ Object
Sets the global variable zuora_sub_link.
Methods inherited from Client
auth_error, bad_request_error, convert_actions, convert_conditions, convert_standard_names_to_ids, convert_ticket_form_agent_conditions, convert_ticket_form_brands, convert_ticket_form_end_user_conditions, convert_ticket_form_names_to_ids, convert_view_names_to_ids, convert_view_restrictions, covert_ticket_form_field_ids, create_package!, erb_renderer, handle_request_error, not_found_error, not_processible_error, put_into_archive, recursively_deflate_directory, timestamp_filename, to_clean_json, to_clean_json_with_key, to_hash, to_nearly_clean_json, to_nearly_clean_json_with_key, to_param_string, write_entries
Class Method Details
.body ⇒ String
Returns the ticket body
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 158 def self.body <<~STRING <p> Greetings, </p> <p> A request has been filed for Report provision failure. </p> <p> 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. </p> <p> The information for this is as follows: </p> <ul> <li>Link to customer in cDot: <a href='#{customer_link}' target='_blank'>#{customer_link}</a></li> <li>cDot provision link: <a href='#{provision_link}' target='_blank'>#{provision_link}</a></li> <li>Zuora subscription link: <a href='#{zuora_sub_link}' target='_blank'>#{zuora_sub_link}</a></li> </ul> <p> Description and error message of the problem that requires assistance. </p> <pre> #{} </pre> <p> Some additional context for this request is: </p> <pre> #{context} </pre> <p> You can find the workflow for this ticket <a href='https://handbook.gitlab.com/handbook/support/license-and-renewals/workflows/self-managed/handling_flagged_provisioning_failures/' target='_blank'>here</a> </p> STRING end |
.context ⇒ Object
Sets the global variable context
112 113 114 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 112 def self.context @context ||= ENV.fetch('LNR_OTHER_CONTEXT') end |
.customer_link ⇒ Object
Sets the global variable customer_link
121 122 123 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 121 def self.customer_link @customer_link ||= ENV.fetch('CDOT_CUSTOMER') end |
.process!(gitlab_client, gitlab_admin_client, zendesk_client) ⇒ Object
Process a Global Internal Request Provision Failure request
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 18 def self.process!(gitlab_client, gitlab_admin_client, zendesk_client) @gitlab_client = gitlab_client @gitlab_admin_client = gitlab_admin_client @zendesk_client = zendesk_client @ticket_forms = Readiness::Zendesk::TicketForms.list(@zendesk_client) @ticket_fields = Readiness::Zendesk::TicketFields.list(@zendesk_client) @lnr_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'L&R', @ticket_forms) @area_of_focus_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Area of Focus', @ticket_fields) @ticket_stage_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket Stage', @ticket_fields) @prfs_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Preferred Region for Support', @ticket_fields) @plan_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'GitLab Plan', @ticket_fields) @sales_name_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Sales contact name', @ticket_fields) @sales_email_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Sales contact email', @ticket_fields) @severity_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Customer Severity (maps to priority, do not change)', @ticket_fields) @arr_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Ticket ARR', @ticket_fields) @priority_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Customer Priority', @ticket_fields) @ir_category_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Category', @ticket_fields) @ir_submitter_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'IR Submitter', @ticket_fields) @channel_field = Readiness::Zendesk::TicketFields.find_by_name(@zendesk_client, 'Channel (Received at email)', @ticket_fields) search = Readiness::Zendesk::Users.find_many(@zendesk_client, [379855863520, 12816218763676]) end_user = search.detect { |s| s.email == 'gitlab_support@example.com' } requester zd_user ticket = Readiness::Zendesk::Tickets.new ticket.email_ccs = [ { user_id: zd_user.id } ] ticket.requester_id = end_user.id ticket.submitter_id = end_user.id ticket.comment = { html_body: body } ticket.subject = 'Internal Request - Provision Failure' ticket. = %w[lnr_internal_request lnr_valid_request lnr_provision_failure] ticket.priority = request_priority ticket.status = 'new' ticket.ticket_form_id = @lnr_form.id ticket.custom_fields = [ { id: @area_of_focus_field.id, value: 'aof_lnr' }, { id: @ticket_stage_field.id, value: 'stage-frt' }, { id: @prfs_field.id, value: 'all_regions' }, { id: @plan_field.id, value: 'free_plan' }, { id: @sales_name_field.id, value: zd_user.name }, { id: @sales_email_field.id, value: zd_user.email }, { id: @severity_field.id, value: 'sev3' }, { id: @arr_field.id, value: '0' }, { id: @priority_field.id, value: 'medium' }, { id: @ir_category_field.id, value: 'ir_provision_failure' }, { id: @ir_submitter_field.id, value: zd_user.email }, { id: @channel_field.id, value: 'created_by_agent' } ] create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket) puts "Ticket created: #{create.id}" end |
.provision_link ⇒ Object
Sets the global variable provision_link
130 131 132 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 130 def self.provision_link @provision_link ||= ENV.fetch('CDOT_PROVISION') end |
.provision_message ⇒ Object
Sets the global variable provision_message
148 149 150 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 148 def self. @provision_message ||= ENV.fetch('PROVISON_DESCRIPTION') end |
.request_priority ⇒ Object
Sets the global variable request_priority
103 104 105 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 103 def self.request_priority @request_priority ||= ENV.fetch('PRIORITY') end |
.requester ⇒ Object
Sets the global variable requester
76 77 78 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 76 def self.requester @requester ||= Readiness::SupportSuperFormProcessor::Shared.gitlab_user_check(@gitlab_admin_client, requester_email) end |
.requester_email ⇒ Object
Sets the global variable requester_email
94 95 96 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 94 def self.requester_email @requester_email ||= ENV.fetch('REQUESTER_EMAIL') end |
.zd_user ⇒ Object
Sets the global variable zd_user
85 86 87 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 85 def self.zd_user @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email) end |
.zuora_sub_link ⇒ Object
Sets the global variable zuora_sub_link
139 140 141 |
# File 'lib/support_readiness/support_super_form_processor/global_ir_provison_failure.rb', line 139 def self.zuora_sub_link @zuora_sub_link ||= ENV.fetch('OTHER_PROVISION_FAILURE') end |