• Resolved bnfw

    (@voltronik)


    Hi,
    I’ve looked through your documentation but I’m getting completely lost looking for something.

    Can you tell me if there’s a hook that’s fired when a new ticket is created and if it contains information about the ticket? If there is one, can you tell me what it is and link me to your documentation page for it?

    Also, is there a hook for when a ticket is updated by the author? I.e. Not by the support agent, but by the original ticket author.

    Thanks,
    Jack

    • This topic was modified 6 years, 11 months ago by bnfw. Reason: Forgot to add second question
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author awesomesupport

    (@awesomesupport)

    Hi:

    I wasn’t clear if you wanted a hook before or after the ticket was successfully opened.

    Here is the one for after:

    do_action( ‘wpas_open_ticket_after’, $ticket_id, $data );

    There is no official documentation on the hooks. You can find the hooks related to new tickets in a file called includes/functions-post.php. A simple search in that file for “do_action” will show you all the hooks for new tickets (and more).

    Thanks.

    Thread Starter bnfw

    (@voltronik)

    Hi @awesomesupport,
    Thanks, that’s helpful. I was after a hook for after the ticket was created.

    Is there one for when a ticket is updated by the original ticket author too?

    Thanks,
    Jack

    Plugin Author awesomesupport

    (@awesomesupport)

    Hi:

    Look in that same file for a function called wpas_insert_reply – you’ll see all the hooks for adding a reply in there. You can also used standard WP POST hooks on the reply custom post type (“ticket_reply”).

    Thanks.

    Thread Starter bnfw

    (@voltronik)

    Hi @awesomesupport,
    That’s great, thanks.

    Jack

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hook for when a new ticket is created’ is closed to new replies.