Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
create dummy tickets inside Zendesk for testing purposes
require 'zendesk_api'
require 'net/http'
client = ZendeskAPI::Client.new do |config|
config.url = "https://{{subdomain}}.zendesk.com/api/v2"
config.username = "email_here"
config.token = "token_here"
config.retry = true
end
for i in 1..50
resp = Net::HTTP.get_response(URI.parse('http://loripsum.net/api/1/plaintext/headers/short'))
subject = resp.body.match(/^(.*)$/)[0].to_s
resp = Net::HTTP.get_response(URI.parse('http://jaspervdj.be/lorem-markdownum/markdown-html.html?num-blocks=3'))
description = resp.body
ticket = client.tickets.create(:subject => subject, :comment => { :value => description })
p ticket.url
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment