Notify specific owner on Correspond

I have created a scrip that successfully notifies owners but now I need to be able to only run this scrip when a specific owner is listed on the ticket. I am guessing that I need a Custom Condition for this scrip. So far I have the following:

Description: On Correspond notify specific owner
Condition: User Defined
Action: Notify Owner
Template: Global template: Admin Correspondence
Stage: Transaction Create

Custom Condition:
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $ownerid = $ticket->Owner;

if ($ownerid = 34) {
return 1;
}
else {
return 0;
}

So far, this scrip does not discriminate based on the ticket owner.

Thanks for your help
Kurt Engle

if ($ownerid = 34) {

That is the perl assignment operator, not the numerical comparision
operator

-kevin

Kurt,

I think you need to add a check for a “correspond” transaction to your
condition.

Kenn
LBNLOn Fri, Feb 11, 2011 at 11:37 AM, Kurt Engle engle@4j.lane.edu wrote:

I have created a scrip that successfully notifies owners but now I need to
be able to only run this scrip when a specific owner is listed on the
ticket. I am guessing that I need a Custom Condition for this scrip. So far
I have the following:

Description: On Correspond notify specific owner
Condition: User Defined
Action: Notify Owner
Template: Global template: Admin Correspondence
Stage: Transaction Create

Custom Condition:
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $ownerid = $ticket->Owner;

if ($ownerid = 34) {
return 1;
}
else {
return 0;
}

So far, this scrip does not discriminate based on the ticket owner.

Thanks for your help

Kurt Engle

Kenn can you give me some pointers on how to do that?

Thanks,

KurtFrom: “Kenneth Crocker” kfcrocker@lbl.gov
To: rt-users@lists.bestpractical.com
Sent: Friday, February 11, 2011 12:05:37 PM
Subject: Re: [rt-users] Notify specific owner on Correspond

Kurt,

I think you need to add a check for a “correspond” transaction to your condition.

Kenn
LBNL

Kurt,

This (in Custom Condition) will ensure the code is triggered only on
Correspondence:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $ownerid = $ticket->Owner;

return 0 unless ($trans->Type eq ‘Correspond’ &&
your owner comparison);

Good luck.

Kenn
LBNLOn Fri, Feb 11, 2011 at 1:22 PM, Kurt Engle engle@4j.lane.edu wrote:

Kenn can you give me some pointers on how to do that?

Thanks,

Kurt


*From: *“Kenneth Crocker” kfcrocker@lbl.gov
*To: *rt-users@lists.bestpractical.com
*Sent: *Friday, February 11, 2011 12:05:37 PM
*Subject: *Re: [rt-users] Notify specific owner on Correspond

Kurt,

I think you need to add a check for a “correspond” transaction to your
condition.

Kenn
LBNL

On Fri, Feb 11, 2011 at 11:37 AM, Kurt Engle engle@4j.lane.edu wrote:

I have created a scrip that successfully notifies owners but now I need to
be able to only run this scrip when a specific owner is listed on the
ticket. I am guessing that I need a Custom Condition for this scrip. So far
I have the following:

Description: On Correspond notify specific owner
Condition: User Defined
Action: Notify Owner
Template: Global template: Admin Correspondence
Stage: Transaction Create

Custom Condition:
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $ownerid = $ticket->Owner;

if ($ownerid = 34) {
return 1;
}
else {
return 0;
}

So far, this scrip does not discriminate based on the ticket owner.

Thanks for your help

Kurt Engle


-kurt

Bingo. That took care of it. Thanks for the code.

KurtFrom: “Kenneth Crocker” kfcrocker@lbl.gov
To: rt-users@lists.bestpractical.com
Sent: Monday, February 14, 2011 9:06:28 AM
Subject: Re: [rt-users] Notify specific owner on Correspond

Kurt,

This (in Custom Condition) will ensure the code is triggered only on Correspondence:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $ownerid = $ticket->Owner;

return 0 unless ($trans->Type eq ‘Correspond’ &&
your owner comparison);

Good luck.

Kenn
LBNL