snake Posted August 8, 2022 Share Posted August 8, 2022 It is a common requirement that I will need to follow up on a ticket or just tell client "I am working on it", so I want to stop the ticket status from being changed to "answered" when I reply to tickets, so it has to be changed manually. After some 15 years using WHMCS, it is clear that nobody can remember to change the status before submitting, so I need to create a hook that will do this, otherwise tickets just end up being forgotten or auto closed. I see that I can hook into this herehttps://developers.whmcs.com/hooks-reference/ticket/#ticketadminreply but what would the required hook code be? 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 8, 2022 Share Posted August 8, 2022 So instead of the ticket changing to Answered you want a way to keep certain tickets marked In Progress when you've replied to them? 0 Quote Link to comment Share on other sites More sharing options...
snake Posted August 8, 2022 Author Share Posted August 8, 2022 I don;t want to the status to be automatically changed to "ANSWERED" I want the status to stay the same unless it is changed manually by the person replying to the ticket. 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 8, 2022 Share Posted August 8, 2022 (edited) You could have all tickets change to a certain status when an admin replies to them, e.g. In Progress. If you don't like In Progress then you could create a new ticket status (System Settings > Support > Ticket Statuses) and set it to not auto close and show in the active tickets/awaiting reply tickets. Just change the status in the hook below to match. <?php use WHMCS\Database\Capsule; function set_ticket_status_after_reply($vars) { $status = 'In Progress'; Capsule::table('tbltickets')->where('id', $vars['ticketid'])->update([ 'status' => $status ]); } add_hook('TicketAdminReply', 1, 'set_ticket_status_after_reply'); Or if you prefer to use the API instead of a direct database call <?php function set_ticket_status_after_reply($vars) { $status = 'In Progress'; localAPI('UpdateTicket', [ 'ticketid' => $vars['ticketid'], 'status' => $status ]); } add_hook('TicketAdminReply', 1, 'set_ticket_status_after_reply'); Edited August 8, 2022 by leemahoney3 0 Quote Link to comment Share on other sites More sharing options...
snake Posted August 9, 2022 Author Share Posted August 9, 2022 I don;t want to automatically change the status at all, I want to leave it as is. So if I am replying to a ticket, which has an open status, I want the status to stay as open, unless I change it. If the status is "in progress" then I want the status to stay as "in progress" unless I change it. 0 Quote Link to comment Share on other sites More sharing options...
string Posted August 9, 2022 Share Posted August 9, 2022 What is with this? 0 Quote Link to comment Share on other sites More sharing options...
snake Posted August 9, 2022 Author Share Posted August 9, 2022 ah I had not seen that reply. I thought I had posted this before, but when looking under my profile, I couldn;t see this post anywhere. 0 Quote Link to comment Share on other sites More sharing options...
leemahoney3 Posted August 9, 2022 Share Posted August 9, 2022 Hi Snake, I've just posted a solution in your other thread which should hopefully work. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.