zendesk.support.ticket.create

Create a new Zendesk Support ticket.

Here is an example of a simple ticket creation flow that first asks the
user for their name, email, and phone number, and then creates a ticket:

triggers:
  - keyword: zendesk_support_ticket_create
    when: true
steps:
  - ask: Link user?
    buttons:
      - text: Yes
        result: true
      - text: No
        result: false
  - flow_set: link_user
  - if: (@ flow.link_user )
    then:
      jump: link_ticket
    else:
      next:
  - flow_set:
      link_ticket: false
  - jump: name

  - (link_ticket)
  - ask: Link ticket?
    buttons:
      - text: Yes
        result: true
      - text: No
        result: false
  - flow_set: link_ticket

  - (name)

  # Start "prechat" mode to collect sensitive details, all user responses will be encrypted
  - mode: prechat

  - say: Name?
  - type: text_input
    required: true
    label: Name
    icon: (@ config.icon.person )
    quick_replies:
      - text: Skip (generate)
        result:
  - flow_set: name

  - say: Email?
  - type: email_address_input
    required: true
    quick_replies:
      - text: Skip (blank)
        result:
  - flow_set: email

  - say: Phone?
  - type: text_input
    required: true
    label: Phone
    icon: (@ config.icon.phone )
    quick_replies:
      - text: Skip (blank)
        result:
  - flow_set: phone

  - say: Subject?
  - type: text_input
    required: true
    label: Ticket subject
    quick_replies:
      - text: Skip (generate)
        result:
  - flow_set: subject

  - say: Comment?
  - type: text_input
    required: true
    label: Ticket comment
    quick_replies:
      - text: Skip (use transcript)
        result:
  - flow_set: comment

  # Done "prechat" mode
  - mode:

  - (create)
  - note: This is a note before ticket creation
  - say: Creating or updating user...
  - type: meya.zendesk.support.component.user.create_or_update
    integration: integration.zendesk.support
    link: (@ flow.link_user )
    name: (@ flow.name )
    email: (@ flow.email )
    phone: (@ flow.phone )
  - say: User (@ flow.result.id ) created or updated
  - say: Creating ticket...
  - type: meya.zendesk.support.component.ticket.create
    integration: integration.zendesk.support
    link: (@ flow.link_ticket )
    requester_id: (@ flow.result.id )
    subject: (@ flow.subject )
    comment: (@ flow.comment )
    ticket_form_id: (@ vault.zendesk.support.ticket_form_id )
    brand_id: (@ vault.zendesk.support.brand_id )
  - say: Ticket (@ flow.result.id ) created
  - note: This is a note after ticket creation
  - end

Element details

type: meya.zendesk.support.component.ticket.create
class: ZendeskSupportTicketCreateComponent
path: /meya/zendesk/support/component/ticket/create.py
signature: -

Fields

fielddescription               requiredsignaturedefaulttype
specOverride the original spec for this element.nullSpec
integrationThe reference path to the Zendesk Support integration file. See the integration reference paths documentation for more information.ZendeskSupportIntegrationRef
requester_idThe user who requested this ticket.nullint
subjectThe value of the subject field for this ticket.nullstr
commentAdd a comment to the ticket.nullstr
comment_attachmentsA list of file URLs to attach to the comment. These fileswill be downloaded from the source and then uploaded to Zendesk to ensure they are secured by Zendesk's security policies and user access rights.

Be careful not to attach too many large files that take long to download and upload, as this could exceed the component timeout and cause the component to fail.

If any file fails to download or upload, the component will log the exception in your app's logs.

The file size limit is 50MB per attachment.

There is a 10s timeout per file download and a 10s timeout per file upload.
nulllist
comment_publicControls whether the ticket is public or not.nullbool
tagsAn array of tags to add to the ticket.nulllist
custom_fieldsAn array of the custom field objects consisting of IDs and values.nulllist
ticket_typeThe type of this ticket. Allowed values are problem, incident, question, or task.nullstr
statusThe state of the ticket. Allowed values are new, open, pending, hold, solved, or closed.nullZendeskSupportTicketStatus
priorityThe urgency with which the ticket should be addressed. Allowed values are urgent, high, normal, or low.nullstr
assignee_idThe agent currently assigned to the ticket.nullint
group_idnullint
external_idAn ID you can use to link Zendesk Support tickets to local records.nullstr
ticket_form_idThe ID of the ticket form to render for the ticket.nullint
brand_idThe ID of the brand this ticket is associated with.nullint
contextSend context data with this component's event.{}
dict
sensitivetruebool
triggersActivate these dynamic triggers when the component runs. Check the component triggers guide for more info.[]list
linkWhether to link the ticket to the current Meya thread. This will use the Zendesk ticket ID returned from the API response as the integration thread ID for Meya to link to. If the external_id is not set explicitly in this component, then the Meya thread ID will be used as the external ID on the Zendesk ticket for reference.truebool
followupWhether this new ticket is a followup to an existing ticket that was previously created and linked to the current Meya thread. If the previous ticket ID can be resolved from the current Meya thread, then the old ticket will be marked as Closed and it's ticket ID will be used as the via_followup_source_id on the new ticket.truebool
via_followup_source_idThe ID of the ticket that this new ticket is a followup to. Note, this value will be overridden if the followup field is set to True and a previous ticket ID can be resolved from the current Meya thread.nullint

Usage reference

Basic

triggers:
  - keyword: meya.zendesk.support.component.ticket.create
steps:
  - type: meya.zendesk.support.component.ticket.create
    integration: integration.zendesk_support

Full

triggers:
  - keyword: meya.zendesk.support.component.ticket.create
steps:
  - type: meya.zendesk.support.component.ticket.create
    spec:
      type: STRING
      data:
        STRING: ANY
      timeout: 123
      trigger_when: ANY
    integration: integration.zendesk_support
    requester_id: 123
    subject: STRING
    comment: STRING
    comment_attachments:
      - STRING
    comment_public: false
    tags:
      - STRING
    custom_fields:
      - id: 123
        value: ANY
    ticket_type: STRING
    status: new|open|pending|hold|solved|closed
    priority: STRING
    assignee_id: 123
    group_id: 123
    external_id: STRING
    ticket_form_id: 123
    brand_id: 123
    context:
      STRING: ANY
    sensitive: false
    triggers:
      - type: STRING
        data:
          STRING: ANY
        timeout: 123
        trigger_when: ANY
    link: false
    followup: false
    via_followup_source_id: 123