Will this work?

I want to use a different template for the autoreply for a single queue.
Basically, I’ll be matching the subject to a predetermined string. This string
will only be used by privileged users but, to make certain that only they will
receive this auto reply, I want to set the condition for the scrip to check for
them.

Will it work to use

my %userID;
my $users = new RT::Users(RT::CurrentUser);
$users->LimitToPrivileged;

while (my $user = $users->Next) {
next if $user->Name eq ‘root’;
$userID{$user->Name} = undef;
}

if exists($userID{$self->TicketObj->Creator} {
return 1;
}else{
return(undef);
}

Thanks
Mathew
Keep up with me and what I’m up to: http://theillien.blogspot.com

Hi Matt,

Based on what you’ve said, it looks more complicated than it needs to
be. If all you want to do is fire a scrip when an incoming e-mail subject
line matches a string and the the user is a privileged user, you can use
something like this:

Description: Reset request from privileged user
Condition: User Defined
Action: (Whatever)
Template: (Your template)
Stage: TransactionCreate

Custom condition:
{ ### True if e-mail is from a Privileged user and subject contains "reset"
my $Transaction = $self->TransactionObj;
my $Creator = $Transaction->CreatorObj;
my $val = $Transaction->Type eq ‘Correspond’
&& $Transaction->Subject =~ /\breset\s/i
&& $Creator->Privileged;
return $val;
}

It might need a little tweaking because it’s slightly different from what I
use, but I think it’ll work.

Regards,
Gene

At 09:09 PM 7/5/2007, Mathew Snyder wrote:

I want to use a different template for the autoreply for a single queue.
Basically, I’ll be matching the subject to a predetermined string. This
string
will only be used by privileged users but, to make certain that only they will
receive this auto reply, I want to set the condition for the scrip to
check for
them.

Will it work to use

my %userID;
my $users = new RT::Users(RT::CurrentUser);
$users->LimitToPrivileged;

while (my $user = $users->Next) {
next if $user->Name eq ‘root’;
$userID{$user->Name} = undef;
}

if exists($userID{$self->TicketObj->Creator} {
return 1;
}else{
return(undef);
}

Thanks
Mathew

Keep up with me and what I’m up to: http://theillien.blogspot.com


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Gene LeDuc, GSEC
Security Analyst
San Diego State University