Skip to content

Instantly share code, notes, and snippets.

@Skeyelab
Last active February 23, 2023 17:06
Show Gist options
  • Save Skeyelab/cdc17ac92091ebfa7dfcb500f07b96c2 to your computer and use it in GitHub Desktop.
Save Skeyelab/cdc17ac92091ebfa7dfcb500f07b96c2 to your computer and use it in GitHub Desktop.
class DeleteTicJob
include Sidekiq::Job
sidekiq_options queue: "default", retry_queue: "errors"
def perform(ticket_id)
require "zendesk_api"
client = ZendeskAPI::Client.new do |config|
config.url = ENV["ZENDESK_URL"] # e.g. https://yoursubdomain.zendesk.com/api/v2
config.username = ENV["ZENDESK_USERNAME"]
config.token = ENV["ZENDESK_TOKEN"]
end
client.tickets.destroy!(id: ticket_id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment