Trigger to create a new ticket

Answered

14 Comments

  • Phil Holcombe

    Hi David,

    I imagine it would be possible through the API, if you have development resources.

    Alternatively, have you considered using a trigger that sends an email, that then creates a support ticket? I'm not 100% sure it would work, because Zendesk might catch it as spam, or have some other filters in place. Worth a try.

     

    Phil @ Nexmo



     

    0
  • Jessie Schutz
    Zendesk team member

    Hey David!

    We have a couple of apps in the Apps Marketplace that might help you with this. Neither of them automate the process, but they do allow you to create "linked" or "child/parent" tickets that would accomplish what you're looking to do.

    Either of these apps would allow your agents to create a linked ticket and assign it to your Accounts team, giving them access to the information they might need in the original ticket, while still allowing that ticket to be Solved and prevent skewing your metrics. 

    You can create a macro that your agents can use to quickly fill out the needed fields in the new ticket, so the fact that it's a manual process shouldn't be too cumbersome.

    Hope that helps!

     

    -1
  • Cory Katz

    Any chance there has been an update on this?  I tried to use notifications and triggers to generate a new ticket, but it always gets snagged in Suspended because zendesk sees the requester as it's own email.

    0
  • Jessie Schutz
    Zendesk team member

    Hi Cory!

    No, this functionality hasn't changed. You might be able to set something up to create a ticket automatically using our API, but there's nothing built into the product that will do this for you.

    0
  • Léa Saint-Laurent

    Hey,

    Strongly related question:

    We want to have a trigger create a linked ticket, but that would have the same selected fields as the initial ticket.

    From what I quickly read in regards to the "Project App" and "Linked ticket", doesn't exactly seem like what we need.

    Any other suggestions by any chance?

    Thank you! :)

    0
  • Jessie Schutz
    Zendesk team member

    Hey Lea! Welcome to the Community!

    It's not possible to create tickets of any type with a Trigger, I'm afraid. Is that the only feature you're missing from those two apps, or is there something else you want to do?

    0
  • Chris Johnson

    Are we any closer to having a solution for this.  My example is related to onboarding new staff.  WHen a new recruit is appointed I want a process in place that will raise tickets to purchasing to get a new PC and phone, to HR to set up their PAYE, Pension etc, to IT to set up a network account and telephone extension and to business apps to set up their credentials on the apps they will be using.  Likewise when someone leaves we need a similar auditable process with actions to different departments to complete.

    0
  • Nicole S.
    Zendesk Community Team

    Hi Chris -

    We have not added any new trigger conditions around creating new tickets, however I have marked your comment as product feedback and submitted it to the product team for consideration. They will follow up with you if they have any further questions.

    0
  • Angela Franklin

    This would be a great feature request.   If we could create a trigger that would automatically create a ticket for a separate support address when I get a ticket with a specific criteria.  I dont want to add a child ticket for another group to my ticket. It would be nice for them to have their own ticket.  Seems like an easy feature request to allow us to set a trigger to email a support address which would then open a ticket for them. 

    0
  • Brett Bowser
    Zendesk Community Team

    Hi Angela,

    This functionality doesn't exist currently but we greatly appreciate your feedback here :) It looks like the following app fits the needs of most users looking for this functionality so I did want to pass it along in case you found it useful: Split n Close

    Let me know if you have any other questions!

    0
  • Kevin Ford
    Community Moderator

    Now that Split 'n' Close is a paid app and I didn't feel like paying $1800 a year for the functionality, I cobbled something together that replicates the functionality that we need. It could be expanded to more closely replicate split 'n' close but I'll leave that to you. Be warned, this isn't trivial and you're going outside the realm of what Zendesk considers best practice.

    You're going to create a ticket via the API and trigger this by notifying an external target. So, to start, create an external HTTP target. For the URL, use https://YOURDOMAIN.zendesk.com/api/v2/tickets.json but replace YOURDOMAIN with your actual domain. Method is POST. Content type is JSON. Enable basic authentication and put in valid credentials.

    Now, you need to build your user interface. I used ticket fields with conditions.

    Drop all of those on your form(s). I set a condition to hide all of the fields when Split Ticket? is unchecked. I also require Subject and Description. Note that if you don't have conditional fields, requiring those fields might be problematic. If you leave them as optional you MUST fill out the description otherwise ticket creation will fail.

    Next, create your trigger. These are the conditions I set:

    And these are the actions:

    Note you want the target to be your ticket creation target. The JSON/Liquid is kind of complex, so here is what I wrote. Note: you MUST change the ticket field ID number (the SubjectIdNum in {{ticket.ticket_field_SubjectIdNum}} to match the ID numbers of your unique fields. Sorry, it's horrible to read.

    {
    "ticket": {
    {% comment %} Set subject to Subject ticket field on parent. Change long number to match actual subject field number. {% endcomment %}
    "subject": "{{ticket.ticket_field_SubjectIdNum}}",
    {% comment %} Set requester to match parent requester. {% endcomment %}
    "requester_id": "{{ticket.requester.id}}",
    {% comment %} Set assignee to match parent assignee. {% endcomment %}
    "assignee_id": "{{ticket.assignee.id}}",
    {% comment %} If copy CCs is checked, add them to the child ticket. Change long number to match actual copy CCs field number. {% endcomment %}
    {% if ticket.ticket_field_CopyCcsIdNum contains 1 %}
    {% comment %} The for loop iterates over all of the CCs and adds them. The if inhibits a trailing comma. {% endcomment %}
    "collaborator_ids": [{% for cc in ticket.ccs %}{{cc.id}}{% if forloop.last %}{% break %}{% else %}, {% endif %} {% endfor %}],
    {% endif %}
    {% comment %} If copy followers is checked, add them to the child ticket. Change long number to match actual copy followers field number. {% endcomment %}
    {% if ticket.ticket_field_CopyFollowersIdNum contains 1 %}
    {% comment %} The for loop iterates over all of the followers and adds them. The if inhibits a trailing comma. {% endcomment %}
    "additional_collaborators": [{% for cc in ticket.followers %}{{cc.id}}{% if forloop.last %}{% break %}{% else %}, {% endif %} {% endfor %}],
    {% endif %}
    "comment": {
    {% comment %} Set first comment to Description ticket field on parent and add a link to parent ticket. Change long number to match actual field number. {% endcomment %}
    "body": "{{ticket.ticket_field_DescriptionIdNum}}\n\nThis request originated in ticket #{{ticket.id}}.",
    {% comment %} If public is checked, the comment on the child will be public. Change long number to match actual public field number. {% endcomment %}
    "public": {% if ticket.ticket_field_PublicIdNum contains 1 %} true {% else %} false {% endif %},
    "author_id": "{{ticket.assignee.id}}"
    }
    }
    }

    Anyway, that's working for us now. Let me know if you have questions.

    2
  • Brett Bowser
    Zendesk Community Team

    Thanks for taking the time to share this with everyone Kevin! This is a great alternative workflow that I think other users will find super helpful.

    Would you be willing to submit this as a user tip under our User Tips and Best Practices topic? This would provide more visibility to other users and we'd love to send you some swag for your help :)

    Thanks again!

    0
  • Kevin Ford
    Community Moderator

    Hi Brett,

    I posted this in User Tips and Best Practices even though it isn't a best practice!

    KF

    0
  • Brett Bowser
    Zendesk Community Team

    Awesome. Thanks Kevin!

    0

Please sign in to leave a comment.

Powered by Zendesk