Created
December 16, 2014 15:26
-
-
Save luizfaias/c2d9a6232821f491625f to your computer and use it in GitHub Desktop.
create dummy tickets inside Zendesk for testing purposes
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
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