Correspondence scrip help

Hello all,

I am wondering if there is any way to resolve RT action when TECH-1 resolves a ticket with correspondence it will not send out 2 emails to the requestor. The 1st email says the ticket is resolved and the other is basically the same message but using the correspondence template instead of the resolved template.

I tried to use the code below to resolve my issue but its not working because RT sends out the email before my custom action can check if the new ticket value is resolved or not. I believe my scrip would work if status changed to resolve was done before correspondence. Is there any way to fix this?

Maybe changing from Stage: TransactionCreate to TransactionBatch would resolve my problem?

Tue Aug 17 15:57:11 2004 TECH-1 - Correspondence added
Tue Aug 17 15:57:13 2004 TECH-1 - Status changed from open to resolved

On Correspond
User Defined Notify Requestors and Ccs with template Correspondence

Custom Action:
my $tr = $self->TransactionObj;
if ($tr->Type eq (‘Correspond’ || ‘Comment’) && $tr->NewValue ne ‘resolved’) {
return(1);
} else {
return undef;
}

This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.

Ok, still working on the same issue as yesterday. I think I just need a few lines of code to get this

if ($tr->Type eq ‘Correspond’ && $tr->NewValue ne ‘resolved’)

test condition to work. Currently its not working because Correspond and NewValue condition are not on the same line according to Transactions table on RT3 DB(See Below).

2689 0 305 0 Correspond NULL NULL NULL No Subject 33
2004-08-17 22:57:11

2690 0 305 0 Status Status open resolved NULL 33
2004-08-17 22:57:13

So how would I write a condition to check the NEXT line too?-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Jonathan Chen
Sent: Tuesday, August 17, 2004 4:25 PM
To: RT-Users@lists.bestpractical.com
Subject: [rt-users] Correspondence scrip help

Hello all,

I am wondering if there is any way to resolve RT action when TECH-1 resolves a ticket with correspondence it will not send out 2 emails to the requestor. The 1st email says the ticket is resolved and the other is basically the same message but using the correspondence template instead of the resolved template.

I tried to use the code below to resolve my issue but its not working because RT sends out the email before my custom action can check if the new ticket value is resolved or not. I believe my scrip would work if status changed to resolve was done before correspondence. Is there any way to fix this?

Maybe changing from Stage: TransactionCreate to TransactionBatch would resolve my problem?

Tue Aug 17 15:57:11 2004 TECH-1 - Correspondence added
Tue Aug 17 15:57:13 2004 TECH-1 - Status changed from open to resolved

On Correspond
User Defined Notify Requestors and Ccs with template Correspondence

Custom Action:
my $tr = $self->TransactionObj;
if ($tr->Type eq (‘Correspond’ || ‘Comment’) && $tr->NewValue ne ‘resolved’) {
return(1);
} else {
return undef;
}

This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.

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

Be sure to check out the RT wiki at http://wiki.bestpractical.com

I am wondering if there is any way to resolve RT action when TECH-1
resolves a ticket with correspondence it will not send out 2 emails to
the requestor. The 1st email says the ticket is resolved and the other
is basically the same message but using the correspondence template
instead of the resolved template.

I tried to use the code below to resolve my issue but its not working
because RT sends out the email before my custom action can check if
the new ticket value is resolved or not. I believe my scrip would work
if status changed to resolve was done before correspondence. Is there
any way to fix this?

Disable the script “On Resolve…” and modify the interface so that the
“resolve” link defaults to Correspond rather than Comment?

Steve

“Outlook not so good.” That magic 8-ball knows everything! I’ll ask
about Exchange Server next.
– (Stolen from the net)

Steve,

Thanks for your attempted help. It still does not solve the problem because on some cases its best to use “comment” resolve instead of correspond resolve when dealing with a client.

If someone can give me FAT clue as to how to go about it would be great. I would not ask the question on this list if I had any idea of how to proceed with problem.

-Jonathan-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Steve Greenland
Sent: Thursday, August 19, 2004 7:43 AM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Correspondence scrip help

On Tue, Aug 17, 2004 at 04:24:34PM -0700, Jonathan Chen wrote:

I am wondering if there is any way to resolve RT action when TECH-1
resolves a ticket with correspondence it will not send out 2 emails to
the requestor. The 1st email says the ticket is resolved and the other
is basically the same message but using the correspondence template
instead of the resolved template.

I tried to use the code below to resolve my issue but its not working
because RT sends out the email before my custom action can check if
the new ticket value is resolved or not. I believe my scrip would work
if status changed to resolve was done before correspondence. Is there
any way to fix this?

Disable the script “On Resolve…” and modify the interface so that the
“resolve” link defaults to Correspond rather than Comment?

Steve

This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.

Thanks for your attempted help. It still does not solve the problem
because on some cases its best to use “comment” resolve instead of
correspond resolve when dealing with a client.

If someone can give me FAT clue as to how to go about it would be
great. I would not ask the question on this list if I had any idea of
how to proceed with problem.

The trouble is that you’re dealing with two distinct transactions.
Sounds like your “on resolve” script will need to look at the previous
transaction, and then bail out if that transaction was a “correspond”,
but not if it was a “comment”. (Nope, don’t have the code to do that,
but the Request Tracker Wiki
shows how to iterate through transactions…)

Steve

“Outlook not so good.” That magic 8-ball knows everything! I’ll ask
about Exchange Server next.
– (Stolen from the net)

Thanks for your attempted help. It still does not solve the problem
because on some cases its best to use “comment” resolve instead of
correspond resolve when dealing with a client.

If someone can give me FAT clue as to how to go about it would be
great. I would not ask the question on this list if I had any idea of
how to proceed with problem.

The trouble is that you’re dealing with two distinct transactions.
Sounds like your “on resolve” script will need to look at the previous
transaction, and then bail out if that transaction was a “correspond”,
but not if it was a “comment”. (Nope, don’t have the code to do that,
but the Request Tracker Wiki
shows how to iterate through transactions…)

I’ve believe I’ve checked that one and thought it was only for “template” use. But looking at that code again, it still does not tell me how to GoToPrevious line. Instead, that one says go to last one. If there is a “previous” function, I would try to write that code in and see how it goes.

-Jonathan

This electronic mail message contains information belonging to PaymentOne, which may be confidential and/or legal privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, printing, copying, distribution, or the taking of any action in reliance on the contents of this electronically mailed information is strictly prohibited. If you receive this message in error, please immediately notify us by electronic mail and delete this message.