I dont understand why you're doing this....
It actually seems quite pointless.
You should set up 3 Departments
Dept A, Dept B, Dept C.
Then 3 Roles
Dept A, Dept B, Dept C.
Role Dept A should have access to Dept A
Role Dept B should have access to Dept B
Role Dept C should have access to Dept C
You should then setup 5 Topics
Topic A, Topic B, Topic C, Topic D, Topic E, Topic F
Topic A should be assigned to Dept A
Topic B should be assigned to Dept B
Topic C should be assigned to Dept C
Topic D should be assigned to Dept A
Topic E should be assigned to Dept B
Topic F should be assigned to Dept C
You should then setup 3 staff members
Staff A, Staff B, Staff C.
Staff A should be Assigned to Dept A
Staff B should be Assigned to Dept B
Staff C should be Assigned to Dept C
The staff should not be assigned as Admins.
All the functionality you have described is core in OST, and you shouldnt need to modify any files. Of course the ticket wont assign to the staff member in the department directly but they will be in the assigned department. As long as you have notification on new ticket ticked for all dept staff or assign the staff as the dept manager they will receive email notification.
Hope this helps :-)