Class: ZendeskAPI::Ticket

Inherits:
Resource show all
Defined in:
lib/zendesk_api/resources.rb,
lib/zendesk_api/resources.rb

Defined Under Namespace

Classes: Audit, Comment, Tag

Instance Attribute Summary

Attributes inherited from DataResource

#error, #error_message

Attributes inherited from Data

#association, #attributes, #response

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Read

#find

Methods included from Destroy

#destroy, #destroyed?

Methods included from Save

#clear_associations, #save, #save!, #save_associations

Methods included from Verbs

#delete, #post, #put

Methods inherited from Data

#/, #==, format, #id, #initialize, #method_missing, #new_record?, #path, resource_name, singular_resource_name, subclasses, #to_json

Constructor Details

This class inherits a constructor from ZendeskAPI::Data

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ZendeskAPI::Data

Class Method Details

+ (Ticket) import(client, attributes)

Imports a ticket through the imports/tickets endpoint

Parameters:

  • client (Client)

    The Client object to be used

  • attributes (Hash)

    The attributes to create.

Returns:

  • (Ticket)

    Created object or nil



249
250
251
252
253
# File 'lib/zendesk_api/resources.rb', line 249

def self.import(client, attributes)
  ticket = new(client, attributes)
  return unless ticket.save(:path => "imports/tickets")
  ticket
end

+ (Collection) incremental_export(client, start_time)

Gets a incremental export of tickets from the start_time until now.

Parameters:

  • client (Client)

    The Client object to be used

  • start_time (Integer)

    The start_time parameter

Returns:



241
242
243
# File 'lib/zendesk_api/resources.rb', line 241

def self.incremental_export(client, start_time)
  ZendeskAPI::Collection.new(client, self, :path => "exports/tickets?start_time=#{start_time.to_i}")
end

Instance Method Details

- (ZendeskAPI::User) assignee

The associated object

Returns:



225
# File 'lib/zendesk_api/resources.rb', line 225

has :assignee, :class => User

- (ZendeskAPI::User) assignee=(value)

The associated object

Parameters:

Returns:



225
# File 'lib/zendesk_api/resources.rb', line 225

has :assignee, :class => User

- (ZendeskAPI::Ticket::Audit) audits(options = {})

The associated object

Parameters:

  • options (Hash) (defaults to: {})

    Options to pass to the collection object

Returns:



227
# File 'lib/zendesk_api/resources.rb', line 227

has_many Audit

- (ZendeskAPI::Ticket::Audit) audits=(value)

The associated object

Parameters:

Returns:



227
# File 'lib/zendesk_api/resources.rb', line 227

has_many Audit

- (ZendeskAPI::User) collaborators(options = {})

The associated object

Parameters:

  • options (Hash) (defaults to: {})

    Options to pass to the collection object

Returns:



226
# File 'lib/zendesk_api/resources.rb', line 226

has_many :collaborators, :class => User

- (ZendeskAPI::User) collaborators=(value)

The associated object

Parameters:

Returns:



226
# File 'lib/zendesk_api/resources.rb', line 226

has_many :collaborators, :class => User

- (ZendeskAPI::Ticket::Comment) comment

The associated object

Returns:



233
# File 'lib/zendesk_api/resources.rb', line 233

has :comment, :class => Comment, :inline => true

- (ZendeskAPI::Ticket::Comment) comment=(value)

The associated object

Parameters:

Returns:



233
# File 'lib/zendesk_api/resources.rb', line 233

has :comment, :class => Comment, :inline => true

- (ZendeskAPI::Topic) forum_topic

The associated object

Returns:



230
# File 'lib/zendesk_api/resources.rb', line 230

has :forum_topic, :class => Topic

- (ZendeskAPI::Topic) forum_topic=(value)

The associated object

Parameters:

Returns:



230
# File 'lib/zendesk_api/resources.rb', line 230

has :forum_topic, :class => Topic

- (ZendeskAPI::Group) group

The associated object

Returns:



229
# File 'lib/zendesk_api/resources.rb', line 229

has Group

- (ZendeskAPI::Group) group=(value)

The associated object

Parameters:

Returns:



229
# File 'lib/zendesk_api/resources.rb', line 229

has Group

- (ZendeskAPI::Ticket::Comment) last_comment

The associated object

Returns:



234
# File 'lib/zendesk_api/resources.rb', line 234

has :last_comment, :class => Comment, :inline => true

- (ZendeskAPI::Ticket::Comment) last_comment=(value)

The associated object

Parameters:

Returns:



234
# File 'lib/zendesk_api/resources.rb', line 234

has :last_comment, :class => Comment, :inline => true

- (ZendeskAPI::Ticket::Comment) last_comments(options = {})

The associated object

Parameters:

  • options (Hash) (defaults to: {})

    Options to pass to the collection object

Returns:



235
# File 'lib/zendesk_api/resources.rb', line 235

has_many :last_comments, :class => Comment, :inline => true

- (ZendeskAPI::Ticket::Comment) last_comments=(value)

The associated object

Parameters:

Returns:



235
# File 'lib/zendesk_api/resources.rb', line 235

has_many :last_comments, :class => Comment, :inline => true

- (ZendeskAPI::TicketMetric) metrics

The associated object

Returns:



228
# File 'lib/zendesk_api/resources.rb', line 228

has :metrics, :class => TicketMetric

- (ZendeskAPI::TicketMetric) metrics=(value)

The associated object

Parameters:

Returns:



228
# File 'lib/zendesk_api/resources.rb', line 228

has :metrics, :class => TicketMetric

- (ZendeskAPI::Organization) organization

The associated object

Returns:



231
# File 'lib/zendesk_api/resources.rb', line 231

has Organization

- (ZendeskAPI::Organization) organization=(value)

The associated object

Parameters:

Returns:



231
# File 'lib/zendesk_api/resources.rb', line 231

has Organization

- (ZendeskAPI::User) requester

The associated object

Returns:



223
# File 'lib/zendesk_api/resources.rb', line 223

has :requester, :class => User, :inline => :create

- (ZendeskAPI::User) requester=(value)

The associated object

Parameters:

Returns:



223
# File 'lib/zendesk_api/resources.rb', line 223

has :requester, :class => User, :inline => :create

- (ZendeskAPI::User) submitter

The associated object

Returns:



224
# File 'lib/zendesk_api/resources.rb', line 224

has :submitter, :class => User

- (ZendeskAPI::User) submitter=(value)

The associated object

Parameters:

Returns:



224
# File 'lib/zendesk_api/resources.rb', line 224

has :submitter, :class => User