Class: ZendeskAPI::Ticket
- Inherits:
-
Resource
- Object
- Data
- DataResource
- Resource
- ZendeskAPI::Ticket
- Extended by:
- CreateMany, DestroyMany, UpdateMany
- Defined in:
- lib/zendesk_api/resources.rb,
lib/zendesk_api/resources.rb
Defined Under Namespace
Classes: Audit, Comment, SatisfactionRating
Instance Attribute Summary
Attributes inherited from DataResource
Attributes inherited from Data
#association, #attributes, #errors, #response
Class Method Summary collapse
- .cbp_path_regexes ⇒ Object
-
.import(client, attributes) ⇒ Ticket
Imports a ticket through the imports/tickets endpoint.
-
.import!(client, attributes) ⇒ Ticket
Imports a ticket through the imports/tickets endpoint using save!.
-
.incremental_export(client, start_time) ⇒ Collection
Gets a incremental export of tickets from the start_time until now.
Instance Method Summary collapse
-
#attribute_changes ⇒ Object
Unlike other attributes, “comment” is not a property of the ticket, but is used as a “comment on save”, so it should be kept unchanged, See github.com/zendesk/zendesk_api_client_rb/issues/321.
Methods included from CreateMany
Methods included from UpdateMany
Methods included from DestroyMany
Methods included from Destroy
#destroy, #destroy!, #destroyed?, included
Methods included from Update
Methods included from Save
#clear_associations, #save, #save!, #save_associations
Methods included from ResponseHandler
Methods included from Create
Methods included from Read
Methods included from Sideloading
Methods included from Verbs
Methods inherited from Data
#==, #attributes_for_save, #id, inherited, #initialize, #loaded_associations, #method_missing, namespace, new_from_response, #new_record?, #path, resource_name, resource_path, #respond_to_missing?, singular_resource_name, subclasses, #to_json, #to_s
Methods included from Associations
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
.cbp_path_regexes ⇒ Object
465 466 467 |
# File 'lib/zendesk_api/resources.rb', line 465 def self.cbp_path_regexes [/^tickets$/, %r{organizations/\d+/tickets}, %r{users/\d+/tickets/requested}] end |
.import(client, attributes) ⇒ Ticket
Imports a ticket through the imports/tickets endpoint
569 570 571 572 573 |
# File 'lib/zendesk_api/resources.rb', line 569 def self.import(client, attributes) ticket = new(client, attributes) return unless ticket.save(path: "imports/tickets") ticket end |
.import!(client, attributes) ⇒ Ticket
Imports a ticket through the imports/tickets endpoint using save!
559 560 561 562 563 |
# File 'lib/zendesk_api/resources.rb', line 559 def self.import!(client, attributes) new(client, attributes).tap do |ticket| ticket.save!(path: "imports/tickets") end end |
.incremental_export(client, start_time) ⇒ Collection
Gets a incremental export of tickets from the start_time until now.
551 552 553 |
# File 'lib/zendesk_api/resources.rb', line 551 def self.incremental_export(client, start_time) ZendeskAPI::Collection.new(client, self, path: "incremental/tickets?start_time=#{start_time.to_i}") end |
Instance Method Details
#attribute_changes ⇒ Object
Unlike other attributes, “comment” is not a property of the ticket, but is used as a “comment on save”, so it should be kept unchanged, See github.com/zendesk/zendesk_api_client_rb/issues/321
472 473 474 |
# File 'lib/zendesk_api/resources.rb', line 472 def attribute_changes attributes.changes.merge("comment" => attributes["comment"]) end |