Hi there
I’m hoping someone can help me. I have a requirement as follows:
We have a queue that is managed during normal working hours by one set of people who watch it very closely and pick up tickets as and when required. Outside normal hours a separate team look after this queue and, because it is alongside other duties, tend not to be as diligent.
I am looking for a way to set this separate group of “out of hours” people up to be AdminCC’s on the queue but only between certain times of day, on certain days of the week. I can’t fathom out how to do this in a scrip, so thought the best way would be to run a job at set times of day that would insert a row into the underlying RT database making this group of users an AdminCC on that queue. At other times of day I would remove that row.
Surely its just a case of cronning a job that does something like:
insert into xyztab values (:queue_id, :group_id, ‘Admincc’) … or something similar once I can fathom out the data model !
So - does anyone know where RT stores this internally? I have looked at all the tables and can’t work it out.
Alternatively, if someone has a better way of achieving the same result then I’m open to all suggestions.
Thanks in advance
Brian
Brian,
Not that I think you need to do this, but an easier way might be to set
up a group with all the rights you want them to have (globaly) and then
either disable them in the morning and re-enable them at night or have a
job do that. Easier and less risk than playing with tables and directories.
Kenn
LBNL
brian mccabe wrote:
I realize this thread is 19 years old but it came up in my search results because I was looking for the same answer and I figured it out on my own. I want other people to be able to find this answer when they find this topic as I did.
Below is the query path I used to figure this out. The AdminCc for a Queue is represented as a Group with the “Domain” as “RT::Queue-Role” and Name as “AdminCc”. You can then see the members in GroupMembers and CachedGroupMembers and look at the Users table to figure out who the IDs belong to, and add/remove records to/from these two tables to change the AdminCc users.
select * from rt5.Queues; -- figure out your queue's ID
SELECT * FROM rt5.Groups where Domain = "RT::Queue-Role" and Instance = 5 and Name = "AdminCc"; -- instance is queue's ID
select * from rt5.GroupMembers where GroupId = 113; -- ID of above row
select * from rt5.CachedGroupMembers where GroupId = 113; -- ID of above row
select * from rt5.Users where id = 40588; -- MemberId of above row
My use case for this is that I’m restoring a backup from production constantly and want the AdminCc in development to be different than the production’s setting which is being backed up and restored. I got tired of logging in and going through the UI to accomplish this with every restore, so I’m incorporating SQL into my backup restore to be able to do that automatically for me. I realize that modifying the RT database with SQL is usually not a good idea so I wouldn’t do this in a production environment.
1 Like