Well I kinds depends. If you are looking to do it through the API then you should first call SupportManagerTickets::add() like this
$ticket_data = [
'vars' => [
'department_id' => 1,
'staff_id' => 1, // This field is optional
'service_id' => 1, // This field is optional
'client_id' => 1, // This field is optional
'email' => 'firsttes@mailinator.com', // This field is optional
'summary' => 'Something is terribly wrong',
'priority' => 'critical',
'status' => 'open'
]
]
$ticket = $api->post("support_manager.support_manager_tickets", "add", $ticket_data);
On the other hand, if you are within Blesta you should be able to use the loader to access the model even though it's from a plugin. In a controller that would look like this
$ticket_data = [
'department_id' => 1,
'staff_id' => 1, // This field is optional
'service_id' => 1, // This field is optional
'client_id' => 1, // This field is optional
'email' => 'firsttes@mailinator.com', // This field is optional
'summary' => 'Something is terribly wrong',
'priority' => 'critical',
'status' => 'open'
];
$this->uses(['SupportManager.SupportManagerTickets']);
$ticket = $this->SupportManagerTickets->add($ticket_data);