Oh so since I can't get the mod to work, I've decided to jury-rig this using php to change the auto-assignment database value for help topics.
Basically, a ticket comes in, it by default gets the help-topic "report a problem". Under the help-topic "report a problem" you can set auto-assignment.
Ok groovy, so I thought, I could create a PHP script that runs on cron and changes the value of the 'auto-assign to' value to the team/agent I want to assign tickets to at the time the cron runs.
Looked up where the value resides in the database and I'm confident it is located here, under the table "ost_help_topic".
Ok, so good so far.
Here is my code:
<?php
$servername = "localhost";
$username = "myusername";
$password = "mypassword";
$dbname = "mydatabase";
//Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Check connection
if($conn->connect_error) {
die("Connection failed:" . $conn->connect_error);
}
$sql = "UPDATE ost_help_topic SET team_id='7' WHERE topic_id=10";
if (mysqli_query($conn, $sql)) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . mysqli_error($conn);
}
mysqli_close($conn);
?>
I run the code and check the "team_id" value in the database, and lo and behold it has indeed been changed and updated.
HOWEVER, when I go back to the Help-Topic page on osTicket the changes are not reflected there. The value is still left on the previous one, e.g. "Devs", even though I know that team has a different ID in the database.
I tested created a ticket and seeing where the system auto-assigns and it still auto-assigns it to "Devs" even though my PHP code changes the value to another team, "Team A" in this example. And I see that the value in the database is the value for Team A.
What am I missing here?