Last active
February 23, 2023 17:06
-
-
Save Skeyelab/cdc17ac92091ebfa7dfcb500f07b96c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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