Last active
August 29, 2015 14:01
-
-
Save chechuironman/9f89441888c41772a9ba to your computer and use it in GitHub Desktop.
Get Tickets
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
#!/usr/bin/ruby | |
################################################################################## | |
# Get all tickets from an Account | |
# ©Copyright IBM Corporation 2014. | |
# LICENSE: MIT (http://opensource.org/licenses/MIT) | |
# gems used: | |
# rubygems, softlayer-api | |
################################################################################## | |
require 'rubygems' | |
require 'softlayer_api' | |
user='xxx' | |
api='xxx' | |
account = SoftLayer::Service.new("SoftLayer_Account",:username => user,:api_key => api) | |
tickets=account.getTickets | |
ticket = SoftLayer::Service.new("SoftLayer_Ticket",:username => user,:api_key => api) | |
for item in tickets | |
puts "" | |
puts "" | |
puts "#################################################################" | |
puts "#################################################################" | |
puts "#################### NEW TICKET ##############################" | |
puts "#################################################################" | |
puts "#################################################################" | |
puts "" | |
updates= ticket.object_with_id(item['id']).getUpdates | |
puts " ID: #{item['id']}, Title: #{item['title']}" | |
for update in updates | |
if update['editorType'] != 'AUTO' then | |
puts "" | |
puts "########################## COMMENT ##############################################" | |
puts "Editor: #{update['editorType']}" | |
puts "Comments: #{update['entry']}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment