Creating new tickets automatically using triggers



  • Bryan - Community Manager
    Zendesk Developer Support Team

    Kev -- you'll need to reference the requester information of your current ticket and pass it to your target in the trigger's JSON payload. You'll need to use dynamic content to do that. Your JSON payload to your target should look something like:

    {"ticket": { "subject": "About your order ", "public": true, "comment" : {"body": "this is my content."}, "priority": "high", "status": "new", "requester":
    {"name": "{{}}", "email": "{{}}"} }

    Note: the description of a ticket is set by the first comment -- use the 'comment' attribute for this, not 'description'. Hope this helps!

  • Bryan - Community Manager
    Zendesk Developer Support Team

    PS -- I moved this to the Q&A section of the Community

  • Andrew J
    Community Moderator

    Hello Kev,

    This is an awesome idea - once you've completed it, please write a tutorial to help others along.  I can see this having several use-case for Zendesk users.  Well done so far!

  • Heather Rommel
    Community Moderator


    I bet it's using you as the Requester because it's using your authentication token. Is there any way to test that theory by using another license to set it up?  I don't know how to get around that but at least you'd be closer to the root cause......

  • Dan Cooper
    Community Moderator

    This is impressive.  I'm curious if using the Requests API instead of the Tickets API might help.  The Requests API handles tickets from the end user side, versus the Tickets API which is on the agent side. I can't say that I'm sure it's the solution you need, but since you want the ticket to be set as the requester, it might be a path worth looking into. 

  • Andrew J
    Community Moderator

    Hello Kevin, have you made any further progress on this?

  • Kev Walsh

    Not yet I'm afraid. Other projects have gotten in the way so haven't made any real progress on this. :-(

  • Donald Dushi

    hi all ,

    I tried and it works well

    1- Settings>Extensions> a new HTTP destination must be created
    2 - In Macro add a new TAG
    3- with a trigger, remove the tag and run the API




  • Bradley Stewart

    I'm not seeing the images from Donald's post but I have a it working. Basically using the same ideas as other extensions/webhooks to use the address to create a new ticket.

    I use an API token for credentials so be sure to create an API token first and have it ready for the extension.

    My extension is configured:

    Extension type: HTTP target

    Title: NEW TICKET


    Method: POST

    Content type: JSON

    Basic Authentication: Enabled

    Username (probably needs to be an admin account)

    Password: -token code here-

    Once you have this extension I use a macro that adds tags and a comment to the current ticket and solves it. The tag sets off a trigger that uses the extension. Once the conditions of the trigger are set you just add the notify target and the JSON to create the ticket. ( Something like:

    Notify Target -> NEW TICKET


    { "ticket": {
    "subject": "Refund check - {{ticket.ticket_field_360003186812}} {{ticket.ticket_field_360003212251}}",
    "comment": { "body": "{{dc.request_check}}" },
    "tags": ["send_check"],
    "requester": { "name": "NameOfRequester", "email": "" },
    "custom_fields": [{"id": CustomFieldID1, "value": "{{ticket.ticket_field_CustomFieldID1}}"}, {"id": CustomFieldID2, "value": "{{ticket.ticket_field_CustomFieldID2}}"}, {"id": CustomFieldID3, "value": "{{ticket.ticket_field_CustomFieldID13}}"}, {"id": CustomFieldID4, "value": "{{ticket.ticket_field_CustomFieldID4}}"}, {"id": CustomFieldID5, "value": "{{ticket.ticket_field_CustomFieldID5}}"}]

    NOTE: The custom fields are mapping the current value on the ticket to the same fields on the new ticket. The {{dc.request_check}} uses a multi line custom field (copied from the original ticket) to populate the first comment with a trigger.

  • Bryan - Community Manager
    Zendesk Developer Support Team

    Thank you very much for sharing this Bradley!

  • Nicole Saunders
    Zendesk Community Team

    This thread has been closed for comments by the Zendesk Community Team. If you have a question you'd like to ask the Zendesk Community, please create a new post


Post is closed for comments.

Powered by Zendesk