Class: Zendesk2::TicketField

Inherits:
Object
  • Object
show all
Extended by:
Attributes
Includes:
Model
Defined in:
lib/zendesk2/ticket_field.rb

Instance Attribute Summary

Attributes included from Model

#errors

Instance Method Summary collapse

Methods included from Attributes

assoc_accessor, assoc_reader, assoc_writer

Methods included from Model

#destroy, #destroyed?, #missing_attributes, #save, #update!

Instance Method Details

#active ⇒ Boolean

Returns Whether this field is available.

Returns:

  • (Boolean) —

    Whether this field is available



11
# File 'lib/zendesk2/ticket_field.rb', line 11

attribute :active, type: :boolean

#agent_description ⇒ String

Returns A description of the ticket field that only agents can see.

Returns:

  • (String) —

    A description of the ticket field that only agents can see



49
# File 'lib/zendesk2/ticket_field.rb', line 49

attribute :agent_description, type: :string

#collapsed_for_agents ⇒ String

Returns If this field should be shown to agents by default or be hidden alongside infrequently used fields.

Returns:

  • (String) —

    If this field should be shown to agents by default or be hidden alongside infrequently used fields



13
# File 'lib/zendesk2/ticket_field.rb', line 13

attribute :collapsed_for_agents, type: :string

#created_at ⇒ Date

Returns The time the ticket field was created.

Returns:

  • (Date) —

    The time the ticket field was created



15
# File 'lib/zendesk2/ticket_field.rb', line 15

attribute :created_at, type: :time

#custom_field_options ⇒ Array

Returns Required and presented for a ticket field of type "tagger".

Returns:

  • (Array) —

    Required and presented for a ticket field of type "tagger"



17
# File 'lib/zendesk2/ticket_field.rb', line 17

attribute :custom_field_options, type: :array

#description ⇒ String

Returns The description of the purpose of this ticket field, shown to users.

Returns:

  • (String) —

    The description of the purpose of this ticket field, shown to users



19
# File 'lib/zendesk2/ticket_field.rb', line 19

attribute :description, type: :string

#destroy! ⇒ Object



65
66
67
68
69
# File 'lib/zendesk2/ticket_field.rb', line 65

def destroy!
  requires :identity

  cistern.destroy_ticket_field('ticket_field' => { 'id' => identity })
end

#editable_in_portal ⇒ Boolean

Returns Whether this field is editable by end users.

Returns:

  • (Boolean) —

    Whether this field is editable by end users



21
# File 'lib/zendesk2/ticket_field.rb', line 21

attribute :editable_in_portal, type: :boolean

#id ⇒ integer

Returns Automatically assigned upon creation.

Returns:

  • (integer) —

    Automatically assigned upon creation



8
# File 'lib/zendesk2/ticket_field.rb', line 8

identity :id, type: :integer

#position ⇒ Integer

Returns A relative position for the ticket fields, determines the order of ticket fields on a ticket.

Returns:

  • (Integer) —

    A relative position for the ticket fields, determines the order of ticket fields on a ticket



23
# File 'lib/zendesk2/ticket_field.rb', line 23

attribute :position, type: :integer

#regexp_for_validation ⇒ String

Returns Regular expression field only. The validation pattern for a field value to be deemed valid.

Returns:

  • (String) —

    Regular expression field only. The validation pattern for a field value to be deemed valid.



25
# File 'lib/zendesk2/ticket_field.rb', line 25

attribute :regexp_for_validation, type: :string

#removable ⇒ Boolean

Returns If this field is not a system basic field that must be present for all tickets on the account.

Returns:

  • (Boolean) —

    If this field is not a system basic field that must be present for all tickets on the account



27
# File 'lib/zendesk2/ticket_field.rb', line 27

attribute :removable, type: :boolean

#required ⇒ Boolean

Returns If it's required for this field to have a value when updated by agents.

Returns:

  • (Boolean) —

    If it's required for this field to have a value when updated by agents



29
# File 'lib/zendesk2/ticket_field.rb', line 29

attribute :required, type: :boolean

#required_in_portal ⇒ Boolean

Returns If it's required for this field to have a value when updated by end users.

Returns:

  • (Boolean) —

    If it's required for this field to have a value when updated by end users



31
# File 'lib/zendesk2/ticket_field.rb', line 31

attribute :required_in_portal, type: :boolean

#save! ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/zendesk2/ticket_field.rb', line 51

def save!
  data = if new_record?
           requires :type, :title

           cistern.create_ticket_field('ticket_field' => attributes)
         else
           requires :identity

           cistern.update_ticket_field('ticket_field' => attributes)
         end.body['ticket_field']

  merge_attributes(data)
end

#system_field_options ⇒ Array

Returns Presented for a ticket field of type "tickettype", "priority" or "status".

Returns:

  • (Array) —

    Presented for a ticket field of type "tickettype", "priority" or "status"



33
# File 'lib/zendesk2/ticket_field.rb', line 33

attribute :system_field_options, type: :array

#tag ⇒ String

Returns A tag value to set for checkbox fields when checked.

Returns:

  • (String) —

    A tag value to set for checkbox fields when checked



35
# File 'lib/zendesk2/ticket_field.rb', line 35

attribute :tag, type: :string

#title ⇒ String

Returns The title of the ticket field.

Returns:

  • (String) —

    The title of the ticket field



37
# File 'lib/zendesk2/ticket_field.rb', line 37

attribute :title, type: :string

#title_in_portal ⇒ String

Returns The title of the ticket field when shown to end users.

Returns:

  • (String) —

    The title of the ticket field when shown to end users



39
# File 'lib/zendesk2/ticket_field.rb', line 39

attribute :title_in_portal, type: :string

#type ⇒ String

Returns The type of the ticket field.

Returns:

  • (String) —

    The type of the ticket field



41
# File 'lib/zendesk2/ticket_field.rb', line 41

attribute :type, type: :string

#updated_at ⇒ Date

Returns The time of the last update of the ticket field.

Returns:

  • (Date) —

    The time of the last update of the ticket field



43
# File 'lib/zendesk2/ticket_field.rb', line 43

attribute :updated_at, type: :time

#url ⇒ String

Returns The URL for this resource.

Returns:

  • (String) —

    The URL for this resource



45
# File 'lib/zendesk2/ticket_field.rb', line 45

attribute :url, type: :string

#visible_in_portal ⇒ Boolean

Returns Whether this field is available to end users.

Returns:

  • (Boolean) —

    Whether this field is available to end users



47
# File 'lib/zendesk2/ticket_field.rb', line 47

attribute :visible_in_portal, type: :boolean