Proxy "requestors" and elegance

Hello,

I have a scrip working well, but I am fairly unsatisfied with it ; I dont
find it elegant. So if you have any opinions regarding improvement of my
solution, please share. :wink:

Problem:
A customer want to open ticket and a subsitute to handle Questions and
Answers. Still the customer want to receive acknowledement at the end, and
have the possibility to track its mail.

My Solution
Having a CF with initial requestor filled on owner Change
Having a onResolve custom scrips substituting back

My problem : to ensure the custom OnResolve he is called before OnResolve
final template is sent.

Other problems :
Do I stock substitution in a Queue customField (how do I access it ?) Do I
stock susbtitution per queue in a custom hash that would associate a
queue name to a substitution in RTSite_Config?
Rights tips so that this custom field cannot be changed or seen.

What are your opinions?

_OnOwnerChange

File ou l’on fait la manip

my @queues = (5,6,7,8,9,10,11,12,13,14, 15);
my $queue_id = $self->TicketObj->Queue;

my $in_queue= grep { /^${queue_id}$/ } @queues;
if ( ! $in_queue ) {

si file pas int�ressante on arrete

return 1;

}

my $ProxyEmail=q{substitue@mydomain.com};

my @adresses=$self->TicketObj->Requestors->MemberEmailAddresses;
my $substitution="";

foreach my $mail (@adresses) {

matching customers emails (per domain)

if ($mail=~ /mycustomer(.*)fr$/) {

$self->TicketObj->AddWatcher(Type => “Requestor”, Email => $ProxyEmail);
$substitution.=qq{$mail from customer changed to $ProxyEmail \n};

my $CFObj = RT::CustomField->new( $RT::SystemUser );
$CFObj->LoadByNameAndQueue( Name => “initialrequestor”, Queue => $queue_id );

my( $st, $msg ) = $self->TicketObj->AddCustomFieldValue(
Field => $CFObj->id,
Value => $mail,
RecordTransaction => 1
);
unless ( $st ) {
$RT::Logger->error( “SCRIP: substitution : Set fields :: $mail not
substitued :”. $msg );
return 1;
}

$self->TicketObj->DeleteWatcher(Type => “Requestor”, Email => $mail);

}
}
if ("$substitution) {
$self->TicketObj->Comment(Content => <<END);
$substitution
END
}

return 1;

SCRIP2

_OnResolve

my $CF = RT::CustomField->new( $RT::SystemUser );
my
$initial_mail=$self->TicketObj->FirstCustomFieldValue(‘initialrequestor’);
if (!$initial_mail) {

pas de bras pas de chocolat

return 1 ;
}

$self->TicketObj->AddWatcher(Type => “Requestor”, Email => $initial_mail);

on enl�ve le proxy

my $ProxyEmail = q{substitue@mydomain.com};

my @adresses=$self->TicketObj->Requestors->MemberEmailAddresses;
my $substitution="";
foreach my $mail (@adresses) {
if ($mail== $ProxyEmail) {

$self->TicketObj->DeleteWatcher(Type => “Requestor”, Email => $ProxyEmail);

$substitution="$ProxyEmail subsituted by $initial_mail";
}
}

$self->TicketObj->Comment(Content => <<END);
$substitution
END

return 1;

Julien Tayon // digital craftsman // making things simpler (when possible)

A lot of people I know believe in positive thinking, and so do I. I
believe everything positively stinks.
– Lew Col

Comments below.

Hello,

I have a scrip working well, but I am fairly unsatisfied with it ; I dont
find it elegant. So if you have any opinions regarding improvement of my
solution, please share. :wink:

Problem:
A customer want to open ticket and a subsitute to handle Questions and
Answers. Still the customer want to receive acknowledement at the end, and
have the possibility to track its mail.

As I understand customer uses SelfService and on resolve he can again
see ticket, right? You just don’t want to notify him until ticket is
resolved. If you don’t use Cc in this queues then you can put customer
there and a substitute into Requestors. In this case you’ll have to
adjust notification scrips.

My Solution
Having a CF with initial requestor filled on owner Change
Having a onResolve custom scrips substituting back

My problem : to ensure the custom OnResolve he is called before OnResolve
final template is sent.

Since 3.6.x scrips are ordered according to description column, but
not that only in 3.8.x RT’s default have not NULL description. NULLs
are always first or last depending on database.

Other problems :
Do I stock substitution in a Queue customField (how do I access it ?) Do I
stock susbtitution per queue in a custom hash that would associate a
queue name to a substitution in RTSite_Config?

$ticket->QueueObj->FirstCustomFieldValue(“Name”);
use hash if you like, but you’ll have to restart server.

Rights tips so that this custom field cannot be changed or seen.

What are your opinions?

I think the solution will do the job.

[snip]

Best regards, Ruslan.