Er ya, I totally missed that part in your original post. My bad.
That is a bit more complicated and would require more changes to get done right -- modify the Blesta Admin GUI to allow admins reorder departments, which would require controller code changes as well as add an extra column to the database schema. No simple one line fix.
I would highly recommend and avoid changing the id column in the database. That id is the primary key and used in multiple tables as you noted earlier.
The hackiest solution I can think of would be to modify views/default/client_tickets_departments.pdt and hard code the order there. I have not tested this code but something like this should work:
20 $departmentsSorted = array();
21 foreach ($this->Html->ifSet($departments, []) as $department) {
22 if($department->name == 'Test 2')
23 $departmentedSorted = array_unshift($departmentsSorted,$department);
24 else if($department->name == 'Test 3')
25 $departmentedSorted = array_unshift($departmentsSorted,$department);
26 // All other departments get pushed to the end
27 else
28 $departmentedSorted = array_push($departmentsSorted,$department);
29 }
30 foreach ($this->Html->ifSet($departmentsSorted, []) as $department) {
Test 3 is the name of the department and it will be shown first. array_unshift inserts to the front of the list while push inserts to the end. You could also use $department->id which would allow you to change the department name without having to re-do this file.
If you are looking for something more complex, then you need to get some custom work done.
-Adam