Class: IssueCentre::TicketConnection

Inherits:
GenericConnection show all
Defined in:
lib/issue_centre/ticket_connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(customer_url, session_key, options = {}) ⇒ CustomerConnection

Connection client for authenticating and retrieving ticket information from IssueCentre

Parameters:



16
17
18
19
# File 'lib/issue_centre/ticket_connection.rb', line 16

def initialize( customer_url, session_key, options = {})
  #      @session_key = session_key
  super( customer_url, options)
end

Instance Method Details

#get_closed_tickets(session_key, company_id, page_size, page_num) ⇒ Array

Return (closed) tickets from IssueCentre for this contract

Parameters:

  • session_key (SessionKey)

    SessionKey object

  • company_id (Integer)

    A Company ID for the function to return closed tickets for. Zero returns a list of all closed tickets across all companies.

  • page_size (Integer)

    The number of tickets to be returned per page.

  • page_num (Integer)

    Which page number [1+] to return tickets for.

Returns:

  • (Array)

    An array of closed tickets and details as hashes



61
62
63
64
65
66
67
68
69
# File 'lib/issue_centre/ticket_connection.rb', line 61

def get_closed_tickets( session_key, company_id, page_size, page_num)
  response_xml = self.call( :get_closed_tickets, message: {
                              arg0: session_key,
                              arg1: company_id,
                              arg2: page_size,
                              arg3: page_num
                            })
  response = IssueCentre::Response.parse( response_xml)
end

#get_events_for_ticket(session_key, ticket_id) ⇒ Array

Return all events from IssueCentre for this ticket

Parameters:

  • session_key (String)

    SessionKey object

  • ticket_id (Integer)

    Ticket ID for the required ticket

Returns:

  • (Array)

    An array of events and details as hashes



80
81
82
83
84
85
86
# File 'lib/issue_centre/ticket_connection.rb', line 80

def get_events_for_ticket( session_key, ticket_id)
  response_xml = self.call( :get_events_for_ticket, message: {
                              arg0: session_key,
                              arg1: ticket_id
                            })
  response = IssueCentre::Response.parse( response_xml)
end

#get_open_tickets(session_key, company_id, page_size, page_num) ⇒ Array

Return (open) tickets from IssueCentre for this contract

Parameters:

  • session_key (String)

    SessionKey for this session

  • company_id (Integer)

    A Company ID for the function to return open tickets for. Zero returns a list of all open tickets across all companies.

  • page_size (Integer)

    The number of tickets to be returned per page.

  • page_num (Integer)

    Which page number [1+] to return tickets for.

Returns:

  • (Array)

    An array of open tickets and details as hashes



36
37
38
39
40
41
42
43
44
# File 'lib/issue_centre/ticket_connection.rb', line 36

def get_open_tickets( session_key, company_id, page_size, page_num)
  response_xml = self.call( :get_open_tickets, message: {
                              arg0: session_key,
                              arg1: company_id,
                              arg2: page_size,
                              arg3: page_num
                            })
  response = IssueCentre::Response.parse( response_xml)
end