Class: Readiness::SupportSuperFormProcessor::USGovIRORderManagement
- Inherits:
-
Client
- Object
- Client
- Readiness::SupportSuperFormProcessor::USGovIRORderManagement
- Defined in:
- lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb
Overview
Defines the class USGovIRORderManagement within the module Zendesk.
Class Method Summary collapse
-
.body ⇒ String
Returns the ticket body.
-
.company ⇒ Object
Sets the global variable company.
-
.contact_email ⇒ Object
Sets the global variable contact_email.
-
.contact_name ⇒ Object
Sets the global variable contact_name.
-
.context ⇒ Object
Sets the global variable context.
-
.current ⇒ Object
Sets the global variable current.
-
.end_date ⇒ Object
Sets the global variable end_date.
-
.opp_link ⇒ Object
Sets the global variable opp_link.
-
.plan ⇒ Object
Sets the global variable plan.
-
.previous ⇒ Object
Sets the global variable previous.
-
.process!(gitlab_client, gitlab_admin_client, zendesk_client) ⇒ Object
Process a US Government Internal Request Order Management request.
-
.requester ⇒ Object
Sets the global variable requester.
-
.requester_email ⇒ Object
Sets the global variable requester_email.
-
.sfdc_account ⇒ Object
Sets the global variable sfdc_account.
-
.start_date ⇒ Object
Sets the global variable start_date.
-
.sub_id ⇒ Object
Sets the global variable sub_id.
-
.sub_name ⇒ Object
Sets the global variable sub_name.
-
.trueup ⇒ Object
Sets the global variable trueup.
-
.version ⇒ Object
Sets the global variable version.
-
.zd_user ⇒ Object
Sets the global variable zd_user.
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
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 217 def self.body <<~STRING <p> Greetings, </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> A request has been filed for Order Management. </p> <p> The information for this is as follows: </p> <ul> <li>Contact's name: #{contact_name}</li> <li>Contact's email: #{contact_email}</li> <li>Contact's company: #{company}</li> <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_opportunity_string(opp_link)}</li> <li>Subscription name: #{sub_name}</li> <li>Subscription ID: #{sub_id}</li> <li>Start date: #{start_date}</li> <li>End date: #{end_date}</li> <li>User count: #{current}</li> <li>Previous user count: #{previous}</li> <li>True-up count: #{trueup}</li> <li>Plan: #{plan}</li> <li>#{Readiness::SupportSuperFormProcessor::Shared.sfdc_account_string(sfdc_account)}</li> <li>GitLab Version: #{version}</li> </ul> <p> Some additional context for this request is: </p> <pre> #{context} </pre> STRING end |
.company ⇒ Object
Sets the global variable company
108 109 110 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 108 def self.company @company ||= ENV.fetch('COMPANY') end |
.contact_email ⇒ Object
Sets the global variable contact_email
99 100 101 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 99 def self.contact_email @contact_email ||= ENV.fetch('CONTACT_EMAIL') end |
.contact_name ⇒ Object
Sets the global variable contact_name
90 91 92 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 90 def self.contact_name @contact_name ||= ENV.fetch('CONTACT_NAME') end |
.context ⇒ Object
Sets the global variable context
81 82 83 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 81 def self.context @context ||= ENV.fetch('LNR_OTHER_CONTEXT') end |
.current ⇒ Object
Sets the global variable current
162 163 164 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 162 def self.current @current ||= ENV.fetch('SEAT_COUNT') end |
.end_date ⇒ Object
Sets the global variable end_date
153 154 155 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 153 def self.end_date @end_date ||= ENV.fetch('EXPIRATION_DATE') end |
.opp_link ⇒ Object
Sets the global variable opp_link
117 118 119 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 117 def self.opp_link @opp_link ||= ENV.fetch('SFDC_OPPORTUNITY') end |
.plan ⇒ Object
Sets the global variable plan
189 190 191 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 189 def self.plan @plan ||= ENV.fetch('SM_PLAN') end |
.previous ⇒ Object
Sets the global variable previous
171 172 173 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 171 def self.previous @previous ||= ENV.fetch('PREVIOUS_COUNT') end |
.process!(gitlab_client, gitlab_admin_client, zendesk_client) ⇒ Object
Process a US Government Internal Request Order Management 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 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.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) @license_issue_form = Readiness::Zendesk::TicketForms.find_by_name(@zendesk_client, 'License Issue', @ticket_forms) @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) requester zd_user unless zd_user..include? 'order_management_team' Readiness::SupportSuperFormProcessor::Shared.not_order_management_member(requester_email) end ticket = Readiness::Zendesk::Tickets.new ticket.requester_id = zd_user.id ticket.submitter_id = zd_user.id ticket.comment = { html_body: body } ticket.subject = 'Internal Request - SM - Order Management' ticket. = %w[lnr_internal_request lnr_valid_request lnr_order_management] ticket.priority = 'normal' ticket.status = 'new' ticket.ticket_form_id = @license_issue_form.id ticket.custom_fields = [ { id: @ir_category_field.id, value: 'ir_order_management' }, { id: @ir_submitter_field.id, value: zd_user.email } ] create = Readiness::Zendesk::Tickets.create!(@zendesk_client, ticket) puts "Ticket created: #{create.id}" end |
.requester ⇒ Object
Sets the global variable requester
54 55 56 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 54 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
72 73 74 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 72 def self.requester_email @requester_email ||= ENV.fetch('REQUESTER_EMAIL') end |
.sfdc_account ⇒ Object
Sets the global variable sfdc_account
198 199 200 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 198 def self.sfdc_account @sfdc_account ||= ENV.fetch('SFDC_ACCOUNT') end |
.start_date ⇒ Object
Sets the global variable start_date
144 145 146 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 144 def self.start_date @start_date ||= ENV.fetch('START_DATE') end |
.sub_id ⇒ Object
Sets the global variable sub_id
135 136 137 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 135 def self.sub_id @sub_id ||= ENV.fetch('ZUORA_SUB_ID') end |
.sub_name ⇒ Object
Sets the global variable sub_name
126 127 128 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 126 def self.sub_name @sub_name ||= ENV.fetch('SUB_NAME') end |
.trueup ⇒ Object
Sets the global variable trueup
180 181 182 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 180 def self.trueup @trueup ||= ENV.fetch('TRUEUP_COUNT') end |
.version ⇒ Object
Sets the global variable version
207 208 209 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 207 def self.version @version ||= ENV.fetch('SM_VERSION') end |
.zd_user ⇒ Object
Sets the global variable zd_user
63 64 65 |
# File 'lib/support_readiness/support_super_form_processor/usgov_ir_order_management.rb', line 63 def self.zd_user @zd_user ||= Readiness::SupportSuperFormProcessor::Shared.zendesk_user_check(@zendesk_client, requester_email) end |