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 (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

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

Instance Attribute Details

- (ZendeskAPI::Association) association Originally defined in class Data

The association

Returns:

  • (ZendeskAPI::Association)

    The association

- (Hash) attributes (readonly) Also known as: to_param Originally defined in class Data

The resource's attributes

Returns:

  • (Hash)

    The resource's attributes

- (Object) error Originally defined in class DataResource

Returns the value of attribute error

- (Object) error_message Originally defined in class DataResource

Returns the value of attribute error_message

- (Array) errors Originally defined in class Data

The last received errors

Returns:

  • (Array)

    The last received errors

- (Object) response Originally defined in class Data

Place to dump the last response

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



257
258
259
260
261
# File 'lib/zendesk_api/resources.rb', line 257

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:



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

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:



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

has :assignee, :class => User

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

The associated object

Parameters:

Returns:



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

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:



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

has_many Audit

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

The associated object

Parameters:

Returns:



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

has_many Audit

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

The associated object

Parameters:

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

    Options to pass to the collection object

Returns:



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

has_many :collaborators, :class => User

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

The associated object

Parameters:

Returns:



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

has_many :collaborators, :class => User

- (ZendeskAPI::Ticket::Comment) comment

The associated object

Returns:



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

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

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

The associated object

Parameters:

Returns:



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

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

- (ZendeskAPI::Topic) forum_topic

The associated object

Returns:



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

has :forum_topic, :class => Topic

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

The associated object

Parameters:

Returns:



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

has :forum_topic, :class => Topic

- (ZendeskAPI::Group) group

The associated object

Returns:



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

has Group

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

The associated object

Parameters:

Returns:



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

has Group

- (ZendeskAPI::Ticket::Comment) last_comment

The associated object

Returns:



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

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

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

The associated object

Parameters:

Returns:



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

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:



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

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

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

The associated object

Parameters:

Returns:



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

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

- (ZendeskAPI::TicketMetric) metrics

The associated object

Returns:



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

has :metrics, :class => TicketMetric

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

The associated object

Parameters:

Returns:



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

has :metrics, :class => TicketMetric

- (ZendeskAPI::Organization) organization

The associated object

Returns:



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

has Organization

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

The associated object

Parameters:

Returns:



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

has Organization

- (ZendeskAPI::User) requester

The associated object

Returns:



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

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

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

The associated object

Parameters:

Returns:



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

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

- (ZendeskAPI::User) submitter

The associated object

Returns:



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

has :submitter, :class => User

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

The associated object

Parameters:

Returns:



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

has :submitter, :class => User