Rt 4.0.4 scrip get current user default queue setting

Hello,

I am working through a scrip to change change the queue to the current
user’s default queue setting on Take. I have everything working when
setting to a static queue string, but I can’t seem to get the current
user’s default queue value.

It seems like it would be something like:
$self->TransactionObj->CreatorObj->DefaultQueue;

If someone could tell me how I can figure it out that would be great. I
would love to know where I can look to find out in the code, or via command
line. The Wiki on CreatorObj says "To Be continued’.

Maybe I am looking at the wrong class object?

Thanks,
Jim

I am working through a scrip to change change the queue to the current user’s default queue
setting on Take. I have everything working when setting to a static queue string, but I can’t
seem to get the current user’s default queue value.
It seems like it would be something like:
$self->TransactionObj->CreatorObj->DefaultQueue;
If someone could tell me how I can figure it out that would be great. I would love to know
where I can look to find out in the code, or via command line. The Wiki on CreatorObj says "To
Be continued’.
Maybe I am looking at the wrong class object?

You’re looking for a Preference (Config) not a User Attribute;

Generally, if you know you’re looking for a Config, you can grep for
the name of the Config and see how it gets used.

$ grep -r DefaultQueue share/html/
share/html/Elements/SelectNewTicketQueue:my $queue = RT->Config->Get(“DefaultQueue”, $session{‘CurrentUser’});
share/html/Elements/SelectNewTicketQueue:if (RT->Config->Get(“RememberDefaultQueue”, $session{‘CurrentUser’})) {
share/html/Elements/SelectNewTicketQueue: if (my $session_default = $session{‘DefaultQueue’}) {
share/html/Elements/SelectNewTicketQueue:$m->callback(Queue => $queue, CallbackName => ‘DefaultQueue’);
share/html/Ticket/Create.html:$session{DefaultQueue} = $Queue;

In your case, you need to pay special attention to the two argument
form of RT->Config->Get because you want the value chosen by a user.

RT->Config->Get(“DefaultQueue”); # global setting from RT_SiteConfig.pm
RT->Config->Get(“DefaultQueue”, $current_user); # RT::CurrentUser object returns the value for that user.

-kevin