Strip the requestor

I need to strip the requestor from tickets belonging to a queue. How do
I do that?

This seems to not be working:

my $newqueue = “Contact\ Us”;
my $newrequestor = “nobody”;
my $T_Obj = $self->TicketObj;

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to queue #".
$newqueue );
my ($status, $msg) = $T_Obj->SetQueue($newqueue);
unless ($status) {
$RT::Logger->warning(“unable to set new queue: $msg”);
return undef;
}

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to user #".
$newrequestor );
my ($status, $msg) = $self->TicketObj->SetRequestor( $newrequestor );
unless( $status ) {
$RT::Logger->error( “Impossible to assign the ticket to
$newrequestor: $msg” );
return undef;
}
return 1;

Anyone?

Need to strip the requestor on create for a specific queue.

Thanks,

RandyFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Randy
Black
Sent: Wednesday, January 04, 2012 2:01 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Strip the requestor

I need to strip the requestor from tickets belonging to a queue. How do
I do that?

This seems to not be working:

my $newqueue = “Contact\ Us”;

my $newrequestor = “nobody”;

my $T_Obj = $self->TicketObj;

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to queue #".
$newqueue );

my ($status, $msg) = $T_Obj->SetQueue($newqueue);

unless ($status) {

$RT::Logger->warning("unable to set new queue: $msg");

return undef;

}

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to user #".
$newrequestor );

my ($status, $msg) = $self->TicketObj->SetRequestor( $newrequestor );

unless( $status ) {

$RT::Logger->error( "Impossible to assign the ticket to

$newrequestor: $msg" );

return undef;

}

return 1;

Looks like it’s probably moving queues and not getting to the SetRequestor. I had this happen to me on a scrip too. Think it’s firing off the change queue event before it finishes the rest of your scrip.

Maybe reverse order of operations or break it into 2 scrips, possible putting the SetRequestor as an “On Queue Change” TransactionCreate scrip on the “Contact Us” queue…From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Randy Black
Sent: Wednesday, January 04, 2012 3:11 PM
To: Randy Black; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Strip the requestor

Anyone?

Need to strip the requestor on create for a specific queue.

Thanks,
Randy

From: rt-users-bounces@lists.bestpractical.commailto:rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Randy Black
Sent: Wednesday, January 04, 2012 2:01 PM
To: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: [rt-users] Strip the requestor

I need to strip the requestor from tickets belonging to a queue. How do I do that?

This seems to not be working:

my $newqueue = “Contact\ Us”;

my $newrequestor = “nobody”;

my $T_Obj = $self->TicketObj;

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to queue #". $newqueue );

my ($status, $msg) = $T_Obj->SetQueue($newqueue);

unless ($status) {

$RT::Logger->warning("unable to set new queue: $msg");

return undef;

}

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to user #". $newrequestor );

my ($status, $msg) = $self->TicketObj->SetRequestor( $newrequestor );

unless( $status ) {

$RT::Logger->error( "Impossible to assign the ticket to $newrequestor: $msg" );

return undef;

}

return 1;

$self->TicketObj->DeleteWatcher(
Type => ‘Requestor’,
Email => ‘Randy.Black@Buckle.com’,
Silent => 1);

Omit the Silent if you want an History entry.

-ChrisAm 04.01.2012 23:10, schrieb Randy Black:

Anyone?

Need to strip the requestor on create for a specific queue.

Thanks,

Randy

*From:*rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Randy Black
Sent: Wednesday, January 04, 2012 2:01 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Strip the requestor

I need to strip the requestor from tickets belonging to a queue. How do
I do that?

This seems to not be working:

my $newqueue = “Contact\ Us”;

my $newrequestor = “nobody”;

my $T_Obj = $self->TicketObj;

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to queue #".
$newqueue );

my ($status, $msg) = $T_Obj->SetQueue($newqueue);

unless ($status) {

$RT::Logger->warning(“unable to set new queue: $msg”);

return undef;

}

$RT::Logger->info(“Auto assign ticket #”. $T_Obj->id ." to user #".
$newrequestor );

my ($status, $msg) = $self->TicketObj->SetRequestor( $newrequestor );

unless( $status ) {

$RT::Logger->error( “Impossible to assign the ticket to $newrequestor:
$msg” );

return undef;

}

return 1;


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston � March 5& 6, 2012

Thanks! But what is the wild card for the email value? I need them all stripped.

Thanks again!From: Christian Loos chr.loos@googlemail.com
To: Randy Black Randy.Black@Buckle.com
Cc: rt-users@lists.bestpractical.com
Sent: Thu, Jan 5, 2012 10:59:01 GMT+00:00
Subject: Re: Strip the requestor

$self->TicketObj->DeleteWatcher(
Type => ‘Requestor’,
Email => ‘Randy.Black@Buckle.com’,
Silent => 1);

Omit the Silent if you want an History entry.

-Chris

There is no wildcard value.
You have to remove each requestor.

You can loop over $self->TicketObj->RequestorAddresses

-ChrisAm 05.01.2012 12:22, schrieb Randy Black:

Thanks! But what is the wild card for the email value? I need them all
stripped.

Thanks again!

Seriously, that’s no good. I need to remove everything from the requestor or change it to an internal user (nobody, root). I cannot be sending out emails for this queue. A postfix overhaul is too big to fix a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!
RandyFrom: Christian Loos [mailto:cloos@netcologne.de]
Sent: Thursday, January 05, 2012 6:09 AM
To: Randy Black
Cc: rt-users@lists.bestpractical.com
Subject: Re: Strip the requestor

There is no wildcard value.
You have to remove each requestor.

You can loop over $self->TicketObj->RequestorAddresses

-Chris

Seriously, that’s no good. I need to remove everything from the requestor or change it to an internal user (nobody, root). I cannot be sending out emails for this queue. A postfix overhaul is too big to fix a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!

Use the queue deactivated scrips extension so that the scrips which send emails aren’t run on these particular queues? That way you can preserve who the requestor is, and still not have any email go out.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Seriously, that’s no good. I need to remove everything from the requestor or change it to an internal user (nobody, root). I cannot be sending out emails for this queue. A postfix overhaul is too big to fix a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!

Use the queue deactivated scrips extension so that the scrips which send emails aren’t run on these particular queues? That way you can preserve who the requestor is, and still not have any email go out.

Tim

Can you just use an empty template for the queues that should not send mail?

Cheers,
Ken

Looks like that extension has not had any work since 2010, therefore
should it not be used on a rt4 instance?

Thanks,
RandyFrom: Tim Cutts [mailto:tjrc@sanger.ac.uk]
Sent: Thursday, January 05, 2012 7:20 AM
To: Randy Black
Cc: Christian Loos; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Strip the requestor

Seriously, that’s no good. I need to remove everything from the
requestor or change it to an internal user (nobody, root). I cannot be
sending out emails for this queue. A postfix overhaul is too big to fix
a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!

Use the queue deactivated scrips extension so that the scrips which send
emails aren’t run on these particular queues? That way you can preserve
who the requestor is, and still not have any email go out.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

I didn’t say anything about postfix.

You have to remeove every single requestor within your RT scrip.
There is no method to remove all requestors so you have to loop over
all requestors and remove them one by one.

-ChrisVon: Randy Black [mailto:Randy.Black@Buckle.com]
Gesendet: Donnerstag, 5. Januar 2012 14:18
An: Loos, Christian
Cc: rt-users@lists.bestpractical.com
Betreff: RE: Strip the requestor

Seriously, that’s no good. I need to remove everything from the requestor or change it to an internal user (nobody, root). I cannot be sending out emails for this queue. A postfix overhaul is too big to fix a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!
Randy

From: Christian Loos [mailto:cloos@netcologne.de]
Sent: Thursday, January 05, 2012 6:09 AM
To: Randy Black
Cc: rt-users@lists.bestpractical.com
Subject: Re: Strip the requestor

There is no wildcard value.
You have to remove each requestor.

You can loop over $self->TicketObj->RequestorAddresses

-Chris

So there is no regex or anything that will wild card that? Weird.

Anyway, I know you didn’t mention postfix, I was preempting the fix or filter it with your MTA answer.

The obstacle of removing them one at a time in a loop, is that the emails come from outside of our domain. Not knowing these addresses it’s impossible to remove them before other scrips fire off. The emails back to them on create notify and other scripts, need to be completely disabled.

Thanks for your help Christian!
RandyFrom: Loos, Christian [mailto:CLoos@netcologne.de]
Sent: Thursday, January 05, 2012 7:51 AM
To: Randy Black
Cc: rt-users@lists.bestpractical.com
Subject: AW: Strip the requestor

I didn’t say anything about postfix.

You have to remeove every single requestor within your RT scrip.
There is no method to remove all requestors so you have to loop over
all requestors and remove them one by one.

-Chris

Von: Randy Black [mailto:Randy.Black@Buckle.com]
Gesendet: Donnerstag, 5. Januar 2012 14:18
An: Loos, Christian
Cc: rt-users@lists.bestpractical.com
Betreff: RE: Strip the requestor

Seriously, that’s no good. I need to remove everything from the requestor or change it to an internal user (nobody, root). I cannot be sending out emails for this queue. A postfix overhaul is too big to fix a problem that I am think could/should be easily done in RT.

Any other suggestions? Thanks for your help!
Randy

From: Christian Loos [mailto:cloos@netcologne.de]
Sent: Thursday, January 05, 2012 6:09 AM
To: Randy Black
Cc: rt-users@lists.bestpractical.com
Subject: Re: Strip the requestor

There is no wildcard value.
You have to remove each requestor.

You can loop over $self->TicketObj->RequestorAddresses

-Chris

The obstacle of removing them one at a time in a loop, is that the
emails come from outside of our domain. Not knowing these addresses
it’s impossible to remove them before other scrips fire off. The emails
back to them on create notify and other scripts, need to be completely
disabled.

for ($self->TicketObj->Requestors->MemberEmailAddresses)
{
$ticket->DeleteWatcher(
Type => ‘Requestor’,
Email => $_,
Silent => 1);
}

Mvh,
Mikal Gule
USIT/GAP/W3D

Looks like that extension has not had any work since 2010, therefore
should it not be used on a rt4 instance?

Take Ken’s suggestion and just make blank templates in the queue you
don’t want to send email. It’s a heck of a lot simpler, doesn’t require
that you write Perl, and lets you keep the requestors.

Best,
Thomas

How does this affect the flow of requests coming in and hitting the
global scripts?

Forgot to mention, we are using rt-mailgate with only one email address
to queue address mapping. The requests are then moved to queues based
on scrips and subject conditions.

Thanks All for your help!
RandyFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Thomas
Sibley
Sent: Thursday, January 05, 2012 8:42 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Strip the requestor

Looks like that extension has not had any work since 2010, therefore
should it not be used on a rt4 instance?

Take Ken’s suggestion and just make blank templates in the queue you
don’t want to send email. It’s a heck of a lot simpler, doesn’t require
that you write Perl, and lets you keep the requestors.

Best,
Thomas
RT Training Sessions (http://bestpractical.com/services/training.html)

  • Boston March 5 & 6, 2012