Change ticket status programmatically
-
Hello,
I’m trying to change the status of a ticket programmatically. I tried following the instructions in this ticket but the plugin code seems to have changed since then: https://ww.wp.xz.cn/support/topic/how-can-i-automatically-change-the-status-of-a-ticket/
Is there a new function like $wpscfunction->change_status( $ticket_id, $status_id); that would allow me to do this?
I’ve tried using:
do_action( ‘wpsc_change_ticket_status’, self::$ticket, $prev, $new, $customer_id );
But I get the following error:
Warning: foreach() argument must be of type array|object, string given in /var/www/mysite/docs/wp-content/plugins/supportcandy/includes/models/class-wpsc-agent.php on line 933
Fatal error: Uncaught Error: Call to undefined method stdClass::get_current_read_permission_agents() in /var/www/mysite/docs/wp-content/plugins/supportcandy/includes/models/class-wpsc-agent.php:938 Stack trace: #0 /var/www/mysite/docs/wp-includes/class-wp-hook.php(308): WPSC_Agent::change_status() #1 /var/www/mysite/docs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #2 /var/www/mysite/docs/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /var/www/mysite/docs/wp-content/plugins/mysite-reminder/mysite-reminder.php(78): do_action() #4 /var/www/mysite/docs/wp-includes/class-wp-hook.php(308): ReminderEmails->reminder_emails_create_admin_page() #5 /var/www/mysite/docs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #6 /var/www/mysite/docs/wp-includes/plugin.php(517): WP_Hook->do_action() #7 /var/www/mysite/docs/wp-admin/admin.php(259): do_action() #8 /var/www/mysite/docs/wp-admin/tools.php(40): require_once(‘…’) #9 {main} thrown in /var/www/mysite/docs/wp-content/plugins/supportcandy/includes/models/class-wpsc-agent.php on line 938
The topic ‘Change ticket status programmatically’ is closed to new replies.