(Scrip help) Deleting a requestor upon ticket creation

Hello list,

I have a rather strange request, I want to delete a requestor when a
ticket is created. Reason being, as the ticket is assigned to different
queues, replies to requestor are sent by the other queues, and that is
usually not needed for external requests. The easiest way to address
this would be to just remove the requestors on tickets created in that
queue.

Looking at the perldoc for Record.pm, I noticed that we can use
DeleteAttribute, so I tried:
Condition: On create
Action: User Defined
Template: Global Template: Blank
Stage: Transaction Create

Custom Condition:

Custom Action preparation Code: return 1;

Custom action cleanup code:

$self->TicketObj->DeleteAttribute(‘Requestor’);

But nothing’s actually happening, and the requestor is listed on the
webui still. Is there a better way to do this? Am I even barking up the
right tree? Thanks in advance for your help.

Chris Nelson

Chris,

We take a different approach that works pretty well. We prevent
external emails being sent by filtering them out in our SendMail_Local
file. Basically we only send emails that are verified against LDAP. Of
course, a lot depends on how you determine who is external.

Craig-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Chris
Nelson
Sent: Monday, October 15, 2007 4:40 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] (Scrip help) Deleting a requestor upon ticket
creation.

Hello list,

I have a rather strange request, I want to delete a requestor when a
ticket is created. Reason being, as the ticket is assigned to different

queues, replies to requestor are sent by the other queues, and that is
usually not needed for external requests. The easiest way to address
this would be to just remove the requestors on tickets created in that
queue.

Looking at the perldoc for Record.pm, I noticed that we can use
DeleteAttribute, so I tried:
Condition: On create
Action: User Defined
Template: Global Template: Blank
Stage: Transaction Create

Custom Condition:

Custom Action preparation Code: return 1;

Custom action cleanup code:

$self->TicketObj->DeleteAttribute(‘Requestor’);

But nothing’s actually happening, and the requestor is listed on the
webui still. Is there a better way to do this? Am I even barking up the
right tree? Thanks in advance for your help.

Chris Nelson

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

I wish we could do that, but as it happens, that is the only queue that
we don’t want to send out RT replies from because the email that feeds
that queue is an outward-facing public email (support@).
All other queues, we want to be able to communicate owner changes,
replies and such to the external addresses, because the external
addresses coming into those other queues are there for a reason and are
not advertised publicly. So basically, whenever someone sends an email
to support@ (the email which feeds into the
incoming-external queue), we want to create a ticket, but then remove
the requestor so that the external address does not get communications
that might (accidentally or not) be internal private communications.

Patterson, Craig wrote:

Chris,

We take a different approach that works pretty well. We prevent
external emails being sent by filtering them out in our SendMail_Local
file. Basically we only send emails that are verified against LDAP. Of
course, a lot depends on how you determine who is external.

Craig

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Chris
Nelson
Sent: Monday, October 15, 2007 4:40 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] (Scrip help) Deleting a requestor upon ticket
creation.

Hello list,

I have a rather strange request, I want to delete a requestor when a
ticket is created. Reason being, as the ticket is assigned to different

queues, replies to requestor are sent by the other queues, and that is
usually not needed for external requests. The easiest way to address
this would be to just remove the requestors on tickets created in that
queue.

Looking at the perldoc for Record.pm, I noticed that we can use
DeleteAttribute, so I tried:
Condition: On create
Action: User Defined
Template: Global Template: Blank
Stage: Transaction Create

Custom Condition:

Custom Action preparation Code: return 1;

Custom action cleanup code:

$self->TicketObj->DeleteAttribute(‘Requestor’);

But nothing’s actually happening, and the requestor is listed on the
webui still. Is there a better way to do this? Am I even barking up the
right tree? Thanks in advance for your help.

Chris Nelson

I do this with some of our tickets. I’ll post what I use in the morning
if someone else hasn’t already.

Keep up with my goings on at http://theillien.blogspot.com

Chris Nelson wrote:

This is a scrip I use for adding a requestor. All you’d have to do is change
the AddWatcher to DeleteWatcher and set up your conditions to what you need:

Condition: User Defined
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom condition:
You’ll either want to come up with your own or set the condition above to On
Create or whatever.

Custom action preparation code:
return 1;

Custom action cleanup code:
$self->TicketObj->AddWatcher (
Type => ‘Requestor’,
Email => ‘user@company.com’
);

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

Chris Nelson wrote:

That worked!

The custom action cleanup code I had to use is:

my $T_Obj = $self->TicketObj;
my $requestor_address = $T_Obj->RequestorAddresses;
$RT::Logger->info(“********* ReqAddr is $requestor_address”);
$T_Obj->DeleteWatcher (
Type => “Requestor”,
Email => “$requestor_address”
);
$RT::Logger->info(“********* After deletewatcher”);
return 1;

Thanks for your help guys :slight_smile:

Mathew Snyder wrote:

This is a scrip I use for adding a requestor. All you’d have to do is change
the AddWatcher to DeleteWatcher and set up your conditions to what you need:

Condition: User Defined
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom condition:
You’ll either want to come up with your own or set the condition above to On
Create or whatever.

Custom action preparation code:
return 1;

Custom action cleanup code:
$self->TicketObj->AddWatcher (
Type => ‘Requestor’,
Email => ‘user@company.com’
);

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

Chris Nelson wrote:

Hello list,

I have a rather strange request, I want to delete a requestor when a
ticket is created. Reason being, as the ticket is assigned to different
queues, replies to requestor are sent by the other queues, and that is
usually not needed for external requests. The easiest way to address
this would be to just remove the requestors on tickets created in that
queue.

Looking at the perldoc for Record.pm, I noticed that we can use
DeleteAttribute, so I tried:
Condition: On create
Action: User Defined
Template: Global Template: Blank
Stage: Transaction Create

Custom Condition:

Custom Action preparation Code: return 1;

Custom action cleanup code:

$self->TicketObj->DeleteAttribute(‘Requestor’);

But nothing’s actually happening, and the requestor is listed on the
webui still. Is there a better way to do this? Am I even barking up the
right tree? Thanks in advance for your help.

Chris Nelson