Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Todd Chapman
You aren't usint "$trans" any where in this scrip, so that must be
coming from a different scrip.

On 11/9/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Well that fixed the syntax error: but now I get this:
>
> Nov  9 10:31:48 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1949) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 10:31:51 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1691) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
>
>
>
> Huw Selley wrote:
> > Hi,
> >
> > The syntax errror is a missing semicolon on the first line.
> >
> > return 0 unless $self->TransactionObj->Type eq "Resolved"
> >
> > Should be
> >
> > return 0 unless $self->TransactionObj->Type eq "Resolved";
> >
> > Hope this helps.
> > Huw
> >
> >
> > On 9/11/07 2:34, "Matt Westfall" <[EMAIL PROTECTED]> wrote:
> >
> > OK The scrip is running, but it says there are syntax errors!!!
> >
> > Nov  9 09:32:44 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> > "$trans" requires explicit package name at (eval 1780) line 1.
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:45 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> > (eval 1784) line 2, near ""Resolved" return"
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:45 oakie RT:
> > <[EMAIL PROTECTED]> #159/2613 -
> > Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:32:45 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:32:48 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> > (/opt/rt3/lib/RT/I18N.pm:412)
> > Nov  9 09:32:49 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> > (/opt/rt3/lib/RT/I18N.pm:412)
> > Nov  9 09:32:50 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> > "$trans" requires explicit package name at (eval 2779) line 1.
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:51 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> > (eval 2783) line 2, near ""Resolved" return"
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:55 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> > "$trans" requires explicit package name at (eval 1816) line 1.
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:56 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> > (eval 1820) line 2, near ""Resolved" return"
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:56 oakie RT:
> > <[EMAIL PROTECTED]> #159/2615 -
> > Scrip 8  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:32:56 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:32:57 oakie RT:
> > <[EMAIL PROTECTED]> #159/2615 -
> > Scrip 9  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:32:57 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:32:57 oakie RT:
> > <[EMAIL PROTECTED]> #159/2615 -
> > Scrip 18  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:32:57 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:32:58 oakie RT:
> > <[EMAIL PROTECTED]> #159/2615 -
> > Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:32:58 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:32:59 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> > "$trans" requires explicit package name at (eval 1870) line 1.
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:32:59 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> > (eval 1874) line 2, near ""Resolved" return"
> > (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> > Nov  9 09:33:00 oakie RT:
> > <[EMAIL PROTECTED]> #159/2616 -
> > Scrip 10  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:33:00 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> > Nov  9 09:33:00 oakie RT:
> > <[EMAIL PROTECTED]> #159/2616 -
> > Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> > Nov  9 09:33:00 oakie RT:
> > <[EMAIL PROTECTED]> No recipients
> > found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> >
> > Todd Chapman wrote:
>  So the scrip never fires?
> 
>  Try this:
> 
>  return 0 unless $self->TransactionObj->Type eq "Resolved"
>  return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
>  /Yes/i;
>  $RT::Logger->debug("Scrip running");
>  1;
> 
>  See if that puts an entry in your logs.
> 
>  
>  Now playing: Arctic Monkeys - The Bad Thing
>  http://fox

Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Well that fixed the syntax error: but now I get this:

Nov  9 10:31:48 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1949) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 10:31:51 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1691) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)



Huw Selley wrote:
> Hi,
> 
> The syntax errror is a missing semicolon on the first line.
> 
> return 0 unless $self->TransactionObj->Type eq "Resolved"
> 
> Should be
> 
> return 0 unless $self->TransactionObj->Type eq "Resolved";
> 
> Hope this helps.
> Huw
> 
> 
> On 9/11/07 2:34, "Matt Westfall" <[EMAIL PROTECTED]> wrote:
> 
> OK The scrip is running, but it says there are syntax errors!!!
> 
> Nov  9 09:32:44 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1780) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:45 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1784) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:45 oakie RT:
> <[EMAIL PROTECTED]> #159/2613 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:45 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:48 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> (/opt/rt3/lib/RT/I18N.pm:412)
> Nov  9 09:32:49 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> (/opt/rt3/lib/RT/I18N.pm:412)
> Nov  9 09:32:50 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 2779) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:51 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 2783) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:55 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1816) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:56 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1820) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:56 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 8  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:56 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 9  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 18  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:58 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:58 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:59 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1870) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:59 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1874) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> #159/2616 -
> Scrip 10  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> #159/2616 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> 
> Todd Chapman wrote:
 So the scrip never fires?

 Try this:

 return 0 unless $self->TransactionObj->Type eq "Resolved"
 return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
 /Yes/i;
 $RT::Logger->debug("Scrip running");
 1;

 See if that puts an entry in your logs.

 
 Now playing: Arctic Monkeys - The Bad Thing
 http://foxytunes.com/artist/arctic+monkeys/track/the+bad+thing

 On 11/7/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
 OK For my scrip I have:

 Condition: User Defined
 Action: Create Tickets
 Template: Create-Followup
 Stage: Transaction Create

 User Condition is:

 return 0 unless $self->TransactionObj->Type eq "Resolved"

 r

Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Scrip as last suggested:

return 0 unless $self->TransactionObj->Type eq "Resolved"
return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
/Yes/i;
$RT::Logger->debug("Scrip running");
1;

Template 

===Create-Ticket: generate-followup
Queue:  Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket.  Please refer to
previous ticket for more information.
ENDOFCONTENT


Errors --
Nov  9 09:32:44 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1780) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:45 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1784) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:45 oakie RT:
<[EMAIL PROTECTED]> #159/2613 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:45 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:48 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
(/opt/rt3/lib/RT/I18N.pm:412)
Nov  9 09:32:49 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
(/opt/rt3/lib/RT/I18N.pm:412)
Nov  9 09:32:50 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 2779) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:51 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 2783) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:55 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1816) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:56 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1820) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:56 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 8  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:56 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 9  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 18  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:58 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:58 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:59 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1870) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:59 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1874) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> #159/2616 -
Scrip 10  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> #159/2616 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHNHK8b/8X6V5MpAURAqQGAKCiYReUM5MdnWJSPEV+fLqB3Zug8wCbBKPf
qOG/OUDcFdoPsOalWVqquJw=
=BMtH
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Huw Selley
Hi,

The syntax errror is a missing semicolon on the first line.

return 0 unless $self->TransactionObj->Type eq "Resolved"

Should be

return 0 unless $self->TransactionObj->Type eq "Resolved";

Hope this helps.
Huw


On 9/11/07 2:34, "Matt Westfall" <[EMAIL PROTECTED]> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> OK The scrip is running, but it says there are syntax errors!!!
> 
> Nov  9 09:32:44 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1780) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:45 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1784) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:45 oakie RT:
> <[EMAIL PROTECTED]> #159/2613 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:45 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:48 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> (/opt/rt3/lib/RT/I18N.pm:412)
> Nov  9 09:32:49 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
> (/opt/rt3/lib/RT/I18N.pm:412)
> Nov  9 09:32:50 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 2779) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:51 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 2783) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:55 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1816) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:56 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1820) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:56 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 8  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:56 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 9  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 18  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:57 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:58 oakie RT:
> <[EMAIL PROTECTED]> #159/2615 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:32:58 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:32:59 oakie RT: Scrip 22 IsApplicable failed: Global symbol
> "$trans" requires explicit package name at (eval 1870) line 1.
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:32:59 oakie RT: Scrip 23 IsApplicable failed: syntax error at
> (eval 1874) line 2, near ""Resolved" return"
> (/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> #159/2616 -
> Scrip 10  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> #159/2616 -
> Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
> Nov  9 09:33:00 oakie RT:
> <[EMAIL PROTECTED]> No recipients
> found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
> 
> Todd Chapman wrote:
>> So the scrip never fires?
>> 
>> Try this:
>> 
>> return 0 unless $self->TransactionObj->Type eq "Resolved"
>> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
>> /Yes/i;
>> $RT::Logger->debug("Scrip running");
>> 1;
>> 
>> See if that puts an entry in your logs.
>> 
>> 
>> Now playing: Arctic Monkeys - The Bad Thing
>> http://foxytunes.com/artist/arctic+monkeys/track/the+bad+thing
>> 
>> On 11/7/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
>> OK For my scrip I have:
>> 
>> Condition: User Defined
>> Action: Create Tickets
>> Template: Create-Followup
>> Stage: Transaction Create
>> 
>> User Condition is:
>> 
>> return 0 unless $self->TransactionObj->Type eq "Resolved"
>> 
>> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
>> /Yes/i;
>> 
>> 1;
>> 
>> My Template is:
>> 
>> ===Create-Ticket: generate-followup
>> Queue:  Customer Service
>> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
>> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
>> RefersTo:  {$Tickets{'TOP'}->Id() }
>> Content: A follow up was requested on this ticket.  Please refer to
>> previous ticket for more information.
>> ENDOFCONTENT
>> 
>> And still no joy :( :(
>> 
>> Todd Ch

Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Todd Chapman
Please re-post the whole scrip and template fresh.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-09 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

OK The scrip is running, but it says there are syntax errors!!!

Nov  9 09:32:44 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1780) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:45 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1784) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:45 oakie RT:
<[EMAIL PROTECTED]> #159/2613 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:45 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:48 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
(/opt/rt3/lib/RT/I18N.pm:412)
Nov  9 09:32:49 oakie RT: Encode::Guess failed: ; fallback to iso-8859-1
(/opt/rt3/lib/RT/I18N.pm:412)
Nov  9 09:32:50 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 2779) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:51 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 2783) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:55 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1816) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:56 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1820) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:56 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 8  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:56 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 9  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 18  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:57 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:58 oakie RT:
<[EMAIL PROTECTED]> #159/2615 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:32:58 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:32:59 oakie RT: Scrip 22 IsApplicable failed: Global symbol
"$trans" requires explicit package name at (eval 1870) line 1.
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:32:59 oakie RT: Scrip 23 IsApplicable failed: syntax error at
(eval 1874) line 2, near ""Resolved" return"
(/opt/rt3/lib/RT/Condition/UserDefined.pm:69)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> #159/2616 -
Scrip 10  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> #159/2616 -
Scrip 19  (/opt/rt3/lib/RT/Action/SendEmail.pm:252)
Nov  9 09:33:00 oakie RT:
<[EMAIL PROTECTED]> No recipients
found. Not sending. (/opt/rt3/lib/RT/Action/SendEmail.pm:264)

Todd Chapman wrote:
> So the scrip never fires?
> 
> Try this:
> 
> return 0 unless $self->TransactionObj->Type eq "Resolved"
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~ /Yes/i;
> $RT::Logger->debug("Scrip running");
> 1;
> 
> See if that puts an entry in your logs.
> 
> 
> Now playing: Arctic Monkeys - The Bad Thing
> http://foxytunes.com/artist/arctic+monkeys/track/the+bad+thing
> 
> On 11/7/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> OK For my scrip I have:
> 
> Condition: User Defined
> Action: Create Tickets
> Template: Create-Followup
> Stage: Transaction Create
> 
> User Condition is:
> 
> return 0 unless $self->TransactionObj->Type eq "Resolved"
> 
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
> 
> 1;
> 
> My Template is:
> 
> ===Create-Ticket: generate-followup
> Queue:  Customer Service
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: A follow up was requested on this ticket.  Please refer to
> previous ticket for more information.
> ENDOFCONTENT
> 
> And still no joy :( :(
> 
> Todd Chapman wrote:
 
 Now playing: The Decemberists - Summersong
 http://foxytunes.com/artist/the+decemberists/track/summersong

 On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
 There are two TransactionObj there.  So would

 unless ( $self->TransactionObj->Type eq "Resolved" &&
 $self->TransactionObj->Field == FIELD_ID )
{ return 0; }

 return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~

Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-08 Thread Todd Chapman
So the scrip never fires?

Try this:

return 0 unless $self->TransactionObj->Type eq "Resolved"
return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~ /Yes/i;
$RT::Logger->debug("Scrip running");
1;

See if that puts an entry in your logs.


Now playing: Arctic Monkeys - The Bad Thing
http://foxytunes.com/artist/arctic+monkeys/track/the+bad+thing

On 11/7/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> OK For my scrip I have:
>
> Condition: User Defined
> Action: Create Tickets
> Template: Create-Followup
> Stage: Transaction Create
>
> User Condition is:
>
> return 0 unless $self->TransactionObj->Type eq "Resolved"
>
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
>
> 1;
>
> My Template is:
>
> ===Create-Ticket: generate-followup
> Queue:  Customer Service
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: A follow up was requested on this ticket.  Please refer to
> previous ticket for more information.
> ENDOFCONTENT
>
> And still no joy :( :(
>
> Todd Chapman wrote:
> > 
> > Now playing: The Decemberists - Summersong
> > http://foxytunes.com/artist/the+decemberists/track/summersong
> >
> > On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> > There are two TransactionObj there.  So would
> >
> > unless ( $self->TransactionObj->Type eq "Resolved" &&
> > $self->TransactionObj->Field == FIELD_ID )
> >{ return 0; }
> >
> > return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> > /Yes/i;
> >
> > 1;
> >
> >
> > The first check would 1) ensure that the ticket is being resolved &&
> > That the CustomField is Set.
> >
> > Then if Followup is Yes, it would then return 1?
> >
> > What is the purpose of self->transactionobj->Field == ??
> >
> >
> >> That part doesn't make sense. Get rid of it.
> >
> > Should I just be checking for if it's Resolved, and if so, checking value?
> >
> >
> >> Yes.
> >
> > Thanks,
> > Matt
> > Tim Wilson wrote:
> >>> On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
>  Matt Westfall <[EMAIL PROTECTED]> wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > I did see that page on the Wiki.  However, I am trying to take an action
> >  when the ticket is resolved, and if a custom field is something.
>  On this part...
> 
>  unless (
>   ( $self->TransactionObj->Type eq "CustomField"
> &&  $self->TransactionObj->Field == FIELD_ID )
>   ||  $self->TransactionObj->Type eq "Create"
>   ) {
> return 0;
>  }
> 
>  return 0 unless 
>  $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') =~ 
>  /CUSTOM_FIELD_VALUE/i;
> 
>  1;
> 
>  You could probaby change the TransactionObj type to "Resolved."
> 
>  -Tim
> 
> 
> ___
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>
> SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
> >>
> If you sign up for a new RT support contract before December 31, we'll take
> up to 20 percent off the price. This sale won't last long, so get in
> touch today.
> Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
> >>
> >>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
> >>
> >>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
> >>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
>
> iD8DBQFHMiOtb/8X6V5MpAURAjHlAJ4h0EtG5gBhUr0aAEBDKZ0lwDQDGgCgl/Gw
> A5tnyG598thLEFR4Ug/rKAk=
> =IIzu
> -END PGP SIGNATURE-
>
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-07 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

OK For my scrip I have:

Condition: User Defined
Action: Create Tickets
Template: Create-Followup
Stage: Transaction Create

User Condition is:

return 0 unless $self->TransactionObj->Type eq "Resolved"

return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
/Yes/i;

1;

My Template is:

===Create-Ticket: generate-followup
Queue:  Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket.  Please refer to
previous ticket for more information.
ENDOFCONTENT

And still no joy :( :(

Todd Chapman wrote:
> 
> Now playing: The Decemberists - Summersong
> http://foxytunes.com/artist/the+decemberists/track/summersong
>
> On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> There are two TransactionObj there.  So would
>
> unless ( $self->TransactionObj->Type eq "Resolved" &&
> $self->TransactionObj->Field == FIELD_ID )
>{ return 0; }
>
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
>
> 1;
>
>
> The first check would 1) ensure that the ticket is being resolved &&
> That the CustomField is Set.
>
> Then if Followup is Yes, it would then return 1?
>
> What is the purpose of self->transactionobj->Field == ??
>
>
>> That part doesn't make sense. Get rid of it.
>
> Should I just be checking for if it's Resolved, and if so, checking value?
>
>
>> Yes.
>
> Thanks,
> Matt
> Tim Wilson wrote:
>>> On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
 Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> I did see that page on the Wiki.  However, I am trying to take an action
>  when the ticket is resolved, and if a custom field is something.
 On this part...

 unless (
  ( $self->TransactionObj->Type eq "CustomField"
&&  $self->TransactionObj->Field == FIELD_ID )
  ||  $self->TransactionObj->Type eq "Create"
  ) {
return 0;
 }

 return 0 unless 
 $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') =~ 
 /CUSTOM_FIELD_VALUE/i;

 1;

 You could probaby change the TransactionObj type to "Resolved."

 -Tim


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>
SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>>
If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in
touch today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>>
>>
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
>>
>>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
>>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHMiOtb/8X6V5MpAURAjHlAJ4h0EtG5gBhUr0aAEBDKZ0lwDQDGgCgl/Gw
A5tnyG598thLEFR4Ug/rKAk=
=IIzu
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-06 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

OK For my scrip I have:

Condition: User Defined
Action: Create Tickets
Template: Create-Followup
Stage: Transaction Create

User Condition is:

return 0 unless $self->TransactionObj->Type eq "Resolved"

return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
/Yes/i;

1;

My Template is:

===Create-Ticket: generate-followup
Queue:  Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket.  Please refer to
previous ticket for more information.
ENDOFCONTENT

And still no joy :( :(

Todd Chapman wrote:
> 
> Now playing: The Decemberists - Summersong
> http://foxytunes.com/artist/the+decemberists/track/summersong
> 
> On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> There are two TransactionObj there.  So would
> 
> unless ( $self->TransactionObj->Type eq "Resolved" &&
> $self->TransactionObj->Field == FIELD_ID )
>{ return 0; }
> 
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
> 
> 1;
> 
> 
> The first check would 1) ensure that the ticket is being resolved &&
> That the CustomField is Set.
> 
> Then if Followup is Yes, it would then return 1?
> 
> What is the purpose of self->transactionobj->Field == ??
> 
> 
>> That part doesn't make sense. Get rid of it.
> 
> Should I just be checking for if it's Resolved, and if so, checking value?
> 
> 
>> Yes.
> 
> Thanks,
> Matt
> Tim Wilson wrote:
>>> On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
 Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> I did see that page on the Wiki.  However, I am trying to take an action
>  when the ticket is resolved, and if a custom field is something.
 On this part...

 unless (
  ( $self->TransactionObj->Type eq "CustomField"
&&  $self->TransactionObj->Field == FIELD_ID )
  ||  $self->TransactionObj->Type eq "Create"
  ) {
return 0;
 }

 return 0 unless 
 $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') =~ 
 /CUSTOM_FIELD_VALUE/i;

 1;

 You could probaby change the TransactionObj type to "Resolved."

 -Tim


___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>
SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>>
If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in
touch today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>>
>>
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
>>
>>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
>>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHMN5Wb/8X6V5MpAURAp7cAJ4mzlzgIe/UVUvP7V88BIbElfSGowCeLc4X
RHArR81UgN9lNK0pajMszdY=
=TPtD
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Kenneth Crocker

Matt,


	Make sure the stage is set to "TransactionBatch". Then, if the Custom 
Field is supposed to have already been modified BEFORE the transaction 
to resolve, you might try something like this:


# condition execution on trans new status & ticket Custom Field value

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

return ($trans->Type eq "Status" &&
$trans->NewValue eq "resolved" &&
$ticket->FirstCustomFieldValue('Your CF Name') eq "whatever");


If both are to happen at the same time, then try this:

# condition execution on trans new status & new trans Custom Field value

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

if  ($trans->Type eq 'CustomField')
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
 Name => "Your CF Name");
 return 0 unless $cf->id;
 if  ($trans->Field == $cf->id &&
  $trans->NewValue eq "whatever")
  {
   return 0 unless ($trans->Type eq "Status" &&
$trans->NewValue eq "resolved")
  }
}

return 0;


Hope this helps.


Kenn
LBNL


On 11/5/2007 12:14 PM, Matt Westfall wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

There are two TransactionObj there.  So would

unless ( $self->TransactionObj->Type eq "Resolved" &&
$self->TransactionObj->Field == FIELD_ID )
   { return 0; }

return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
/Yes/i;

1;


The first check would 1) ensure that the ticket is being resolved &&
That the CustomField is Set.

Then if Followup is Yes, it would then return 1?

What is the purpose of self->transactionobj->Field == ??

Should I just be checking for if it's Resolved, and if so, checking value?

Thanks,
Matt
Tim Wilson wrote:

On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
Matt Westfall <[EMAIL PROTECTED]> wrote: 

-BEGIN PGP SIGNED MESSAGE-
I did see that page on the Wiki.  However, I am trying to take an action
 when the ticket is resolved, and if a custom field is something.

On this part...

unless (
 ( $self->TransactionObj->Type eq "CustomField"
   &&  $self->TransactionObj->Field == FIELD_ID )
 ||  $self->TransactionObj->Type eq "Create"
 ) {
   return 0;
}

return 0 unless $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') =~ 
/CUSTOM_FIELD_VALUE/i;

1;

You could probaby change the TransactionObj type to "Resolved."

-Tim



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHL3mIb/8X6V5MpAURAjxoAKCmS78HjL9FyNLpp7HRn7pHTHpcVQCg2C0J
maKJYisFKVYAeZk9dIZJXmQ=
=I1eL
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.



Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com



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

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. 
   Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.



Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Todd Chapman
On 11/5/07, Tim Wilson <[EMAIL PROTECTED]> wrote:
> >>> On Mon, Nov 5, 2007 at  2:14 PM, in message <[EMAIL PROTECTED]>,
> Matt Westfall <[EMAIL PROTECTED]> wrote:
> > -BEGIN PGP SIGNED MESSAGE-
>
> > There are two TransactionObj there.  So would
> >
> > unless ( $self->TransactionObj->Type eq "Resolved" &&
> > $self->TransactionObj->Field == FIELD_ID )
> >{ return 0; }
> >
> > return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> > /Yes/i;
> >
> > 1;
> >
> >
> > The first check would 1) ensure that the ticket is being resolved &&
> > That the CustomField is Set.
> >
> > Then if Followup is Yes, it would then return 1?
> >
> > What is the purpose of self->transactionobj->Field == ??
>
> Check the next paragraph on the wiki for the explanation:
>
> --snip--
> where FIELD_ID is the numeric ID of the particular custom field, 
> CUSTOM_FIELD_NAME is the name of the custom field, and CUSTOM_FIELD_VALUE is 
> the text you want to match. Get the FIELD_ID by browsing to the custom 
> field's configuration screen in RT and looking at the URL. The end of the URL 
> will contain the numeric ID of the custom field.
> --snip--
>
> FIELD_ID is a numeric value that you need to find by inspecting the URL in 
> the browser.
>
> -Tim
>

Tim,

In this context FIELD_ID doesn't make sense. It's not set on a Resolve
transaction object.

-Todd

>
> --
> Tim Wilson, Director of Technology
> Buffalo-Hanover-Montrose Schools
> 214 1st Ave NE   Buffalo, MN  55313
> ph: 763.682.8740  fax: 763.682.8743  http://www.buffalo.k12.mn.us
>
>
>
>
>
> ___
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>
> If you sign up for a new RT support contract before December 31, we'll take
> up to 20 percent off the price. This sale won't last long, so get in touch 
> today.
> Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>
>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Tim Wilson
>>> On Mon, Nov 5, 2007 at  2:14 PM, in message <[EMAIL PROTECTED]>,
Matt Westfall <[EMAIL PROTECTED]> wrote: 
> -BEGIN PGP SIGNED MESSAGE-

> There are two TransactionObj there.  So would
> 
> unless ( $self->TransactionObj->Type eq "Resolved" &&
> $self->TransactionObj->Field == FIELD_ID )
>{ return 0; }
> 
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
> 
> 1;
> 
> 
> The first check would 1) ensure that the ticket is being resolved &&
> That the CustomField is Set.
> 
> Then if Followup is Yes, it would then return 1?
> 
> What is the purpose of self->transactionobj->Field == ??

Check the next paragraph on the wiki for the explanation:

--snip--
where FIELD_ID is the numeric ID of the particular custom field, 
CUSTOM_FIELD_NAME is the name of the custom field, and CUSTOM_FIELD_VALUE is 
the text you want to match. Get the FIELD_ID by browsing to the custom field's 
configuration screen in RT and looking at the URL. The end of the URL will 
contain the numeric ID of the custom field.
--snip--

FIELD_ID is a numeric value that you need to find by inspecting the URL in the 
browser.

-Tim


-- 
Tim Wilson, Director of Technology
Buffalo-Hanover-Montrose Schools
214 1st Ave NE   Buffalo, MN  55313
ph: 763.682.8740  fax: 763.682.8743  http://www.buffalo.k12.mn.us





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

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Todd Chapman

Now playing: The Decemberists - Summersong
http://foxytunes.com/artist/the+decemberists/track/summersong

On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> There are two TransactionObj there.  So would
>
> unless ( $self->TransactionObj->Type eq "Resolved" &&
> $self->TransactionObj->Field == FIELD_ID )
>{ return 0; }
>
> return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
> /Yes/i;
>
> 1;
>
>
> The first check would 1) ensure that the ticket is being resolved &&
> That the CustomField is Set.
>
> Then if Followup is Yes, it would then return 1?
>
> What is the purpose of self->transactionobj->Field == ??
>

That part doesn't make sense. Get rid of it.

> Should I just be checking for if it's Resolved, and if so, checking value?
>

Yes.

> Thanks,
> Matt
> Tim Wilson wrote:
>  On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
> > Matt Westfall <[EMAIL PROTECTED]> wrote:
> >> -BEGIN PGP SIGNED MESSAGE-
> >
> >> I did see that page on the Wiki.  However, I am trying to take an action
> >>  when the ticket is resolved, and if a custom field is something.
> >
> > On this part...
> >
> > unless (
> >  ( $self->TransactionObj->Type eq "CustomField"
> >&&  $self->TransactionObj->Field == FIELD_ID )
> >  ||  $self->TransactionObj->Type eq "Create"
> >  ) {
> >return 0;
> > }
> >
> > return 0 unless 
> > $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') =~ 
> > /CUSTOM_FIELD_VALUE/i;
> >
> > 1;
> >
> > You could probaby change the TransactionObj type to "Resolved."
> >
> > -Tim
> >
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
>
> iD8DBQFHL3mIb/8X6V5MpAURAjxoAKCmS78HjL9FyNLpp7HRn7pHTHpcVQCg2C0J
> maKJYisFKVYAeZk9dIZJXmQ=
> =I1eL
> -END PGP SIGNATURE-
> ___
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>
> If you sign up for a new RT support contract before December 31, we'll take
> up to 20 percent off the price. This sale won't last long, so get in touch 
> today.
> Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>
>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

There are two TransactionObj there.  So would

unless ( $self->TransactionObj->Type eq "Resolved" &&
$self->TransactionObj->Field == FIELD_ID )
   { return 0; }

return 0 unless $self->TicketObj->FirstCustomFieldValue('Followup') =~
/Yes/i;

1;


The first check would 1) ensure that the ticket is being resolved &&
That the CustomField is Set.

Then if Followup is Yes, it would then return 1?

What is the purpose of self->transactionobj->Field == ??

Should I just be checking for if it's Resolved, and if so, checking value?

Thanks,
Matt
Tim Wilson wrote:
 On Mon, Nov 5, 2007 at  1:41 PM, in message <[EMAIL PROTECTED]>,
> Matt Westfall <[EMAIL PROTECTED]> wrote: 
>> -BEGIN PGP SIGNED MESSAGE-
> 
>> I did see that page on the Wiki.  However, I am trying to take an action
>>  when the ticket is resolved, and if a custom field is something.
> 
> On this part...
> 
> unless (
>  ( $self->TransactionObj->Type eq "CustomField"
>&&  $self->TransactionObj->Field == FIELD_ID )
>  ||  $self->TransactionObj->Type eq "Create"
>  ) {
>return 0;
> }
> 
> return 0 unless $self->TicketObj->FirstCustomFieldValue('CUSTOM_FIELD_NAME') 
> =~ /CUSTOM_FIELD_VALUE/i;
> 
> 1;
> 
> You could probaby change the TransactionObj type to "Resolved."
> 
> -Tim
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHL3mIb/8X6V5MpAURAjxoAKCmS78HjL9FyNLpp7HRn7pHTHpcVQCg2C0J
maKJYisFKVYAeZk9dIZJXmQ=
=I1eL
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Todd Chapman
Your code will never make it past the first "return 1". So why is the
rest of it there? The code makes no logical sense!


Now playing: The Decemberists - When The War Came
http://foxytunes.com/artist/the+decemberists/track/when+the+war+came

On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> They are condition checks.  Only 1 of them needs to be met.  That's why
> they are return 1.  If any of them are True, then the scrip should run
> the template.
>
> Todd Chapman wrote:
> > The code you posted makes no sense. It has a bunch of "return 1"
> > statements in it so most of it will never be executed. Clean it up and
> > post it and I'll help.
> >
> > 
> > Now playing: The Decemberists - California One/Youth and Beauty Brigade
> > http://foxytunes.com/artist/the+decemberists/track/california+one+youth+and+beauty+brigade
> >
> > On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> > I wish someone would please help me with this relatively simple task.  I
> > bought the RT Essentials book, and the only example it has is creating a
> > new ticket off of a straight Resolve with no conditions.
> >
> > Can someone please help me with this!?!?!
> >
> >
> > I'm having the hardest time figuring out how to create a ticket based on
> > the status of a Custom Field.
> >
> > I have two Custom Fields
> >
> > 1: Billable
> > It's a select one field with values of:
> >Yes
> >No
> >Covered
> >Gratis
> >
> > 2: Followup
> >  It's a select one field with values of:
> > Yes
> > No
> >
> > I have the two corresponding scrips written:
> >
> > 1: Invoice
> >
> > Condition: User Defined
> > Action: Create Tickets
> > Template: Generate-Invoice
> >
> > Custom Condition:
> > return 0 unless $trans->Type eq "Resolve";
> >
> > return undef unless
> > ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> > /Yes/i);
> > return 1;
> > return undef unless
> > ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> > /Gratis/i);
> > return 1;
> >
> > return undef unless
> > ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> > /Covered/i);
> > return 1;
> >
> > 2:
> >
> > Condition: User Defined:
> > Action: Create Tickets:
> > Template: generate-followup
> >
> > Custom Condition:
> >
> > return 0 unless $trans->Type eq "Resolve";
> >
> > return undef unless ($self->TicketObj->FirstCustomFieldValue('Followup')
> > =~ /Yes/i);
> > return 1;
> >
> >
> > I have two corresponding templates created:
> >
> > 1:
> > ===Create-Ticket: generate-invoice
> > Queue:  Accounting
> > Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> > Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> > RefersTo:  {$Tickets{'TOP'}->Id() }
> > Content: Please generate an invoice for this customer.
> > Billable was set to:
> > {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable')}
> >
> > Billable hours was set to:
> > {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable Hours')}
> > Please refer to previous ticket for more information.
> > ENDOFCONTENT
> >
> > 2:
> > ===Create-Ticket: generate-followup
> > Queue:  Customer Service
> > Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> > Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> > RefersTo:  {$Tickets{'TOP'}->Id() }
> > Content: A follow up was requested on this ticket.  Please refer to
> > previous ticket for more information.
> > ENDOFCONTENT
> >
> >
> > I then created a test ticket with Billable set to Yes and Followup to
> > Yes, and neither ticket spawned!!!
> >
> > Help please!!!
> >
> > Thanks in advance,
> > Matt Westfall
> ___
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >>
> SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
> >>
> If you sign up for a new RT support contract before December 31, we'll take
> up to 20 percent off the price. This sale won't last long, so get in
> touch today.
> Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
> >>
> >>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
> >>
> >>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
> >>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
>
> iD8DBQFHL2brb/8X6V5MpAURAg2BAJ4x/vaIuczLH5DK4dM65qAdEGfbIQCcCmwV
> sBQkEf2MJt5E6QGRT/nXNuE=
> =BO0U
> -END PGP SIGNATURE-
>
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECT

Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

They are condition checks.  Only 1 of them needs to be met.  That's why
they are return 1.  If any of them are True, then the scrip should run
the template.

Todd Chapman wrote:
> The code you posted makes no sense. It has a bunch of "return 1"
> statements in it so most of it will never be executed. Clean it up and
> post it and I'll help.
> 
> 
> Now playing: The Decemberists - California One/Youth and Beauty Brigade
> http://foxytunes.com/artist/the+decemberists/track/california+one+youth+and+beauty+brigade
> 
> On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> I wish someone would please help me with this relatively simple task.  I
> bought the RT Essentials book, and the only example it has is creating a
> new ticket off of a straight Resolve with no conditions.
> 
> Can someone please help me with this!?!?!
> 
> 
> I'm having the hardest time figuring out how to create a ticket based on
> the status of a Custom Field.
> 
> I have two Custom Fields
> 
> 1: Billable
> It's a select one field with values of:
>Yes
>No
>Covered
>Gratis
> 
> 2: Followup
>  It's a select one field with values of:
> Yes
> No
> 
> I have the two corresponding scrips written:
> 
> 1: Invoice
> 
> Condition: User Defined
> Action: Create Tickets
> Template: Generate-Invoice
> 
> Custom Condition:
> return 0 unless $trans->Type eq "Resolve";
> 
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Yes/i);
> return 1;
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Gratis/i);
> return 1;
> 
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Covered/i);
> return 1;
> 
> 2:
> 
> Condition: User Defined:
> Action: Create Tickets:
> Template: generate-followup
> 
> Custom Condition:
> 
> return 0 unless $trans->Type eq "Resolve";
> 
> return undef unless ($self->TicketObj->FirstCustomFieldValue('Followup')
> =~ /Yes/i);
> return 1;
> 
> 
> I have two corresponding templates created:
> 
> 1:
> ===Create-Ticket: generate-invoice
> Queue:  Accounting
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: Please generate an invoice for this customer.
> Billable was set to:
> {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable')}
> 
> Billable hours was set to:
> {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable Hours')}
> Please refer to previous ticket for more information.
> ENDOFCONTENT
> 
> 2:
> ===Create-Ticket: generate-followup
> Queue:  Customer Service
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: A follow up was requested on this ticket.  Please refer to
> previous ticket for more information.
> ENDOFCONTENT
> 
> 
> I then created a test ticket with Billable set to Yes and Followup to
> Yes, and neither ticket spawned!!!
> 
> Help please!!!
> 
> Thanks in advance,
> Matt Westfall
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>
SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>>
If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in
touch today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>>
>>
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
>>
>>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
>>
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHL2brb/8X6V5MpAURAg2BAJ4x/vaIuczLH5DK4dM65qAdEGfbIQCcCmwV
sBQkEf2MJt5E6QGRT/nXNuE=
=BO0U
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Todd Chapman
The code you posted makes no sense. It has a bunch of "return 1"
statements in it so most of it will never be executed. Clean it up and
post it and I'll help.


Now playing: The Decemberists - California One/Youth and Beauty Brigade
http://foxytunes.com/artist/the+decemberists/track/california+one+youth+and+beauty+brigade

On 11/5/07, Matt Westfall <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I wish someone would please help me with this relatively simple task.  I
> bought the RT Essentials book, and the only example it has is creating a
> new ticket off of a straight Resolve with no conditions.
>
> Can someone please help me with this!?!?!
>
>
> I'm having the hardest time figuring out how to create a ticket based on
> the status of a Custom Field.
>
> I have two Custom Fields
>
> 1: Billable
> It's a select one field with values of:
>Yes
>No
>Covered
>Gratis
>
> 2: Followup
>  It's a select one field with values of:
> Yes
> No
>
> I have the two corresponding scrips written:
>
> 1: Invoice
>
> Condition: User Defined
> Action: Create Tickets
> Template: Generate-Invoice
>
> Custom Condition:
> return 0 unless $trans->Type eq "Resolve";
>
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Yes/i);
> return 1;
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Gratis/i);
> return 1;
>
> return undef unless
> ($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
> /Covered/i);
> return 1;
>
> 2:
>
> Condition: User Defined:
> Action: Create Tickets:
> Template: generate-followup
>
> Custom Condition:
>
> return 0 unless $trans->Type eq "Resolve";
>
> return undef unless ($self->TicketObj->FirstCustomFieldValue('Followup')
> =~ /Yes/i);
> return 1;
>
>
> I have two corresponding templates created:
>
> 1:
> ===Create-Ticket: generate-invoice
> Queue:  Accounting
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: Please generate an invoice for this customer.
> Billable was set to:
> {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable')}
>
> Billable hours was set to:
> {$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable Hours')}
> Please refer to previous ticket for more information.
> ENDOFCONTENT
>
> 2:
> ===Create-Ticket: generate-followup
> Queue:  Customer Service
> Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
> Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
> RefersTo:  {$Tickets{'TOP'}->Id() }
> Content: A follow up was requested on this ticket.  Please refer to
> previous ticket for more information.
> ENDOFCONTENT
>
>
> I then created a test ticket with Billable set to Yes and Followup to
> Yes, and neither ticket spawned!!!
>
> Help please!!!
>
> Thanks in advance,
> Matt Westfall
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
>
> iD8DBQFHL2Fsb/8X6V5MpAURAvChAJ9qYhZYLRtY1dHQoXqNq48EXELcvACg5Wr6
> rcHlWbl+i866n4Q3bimJE20=
> =ZK86
> -END PGP SIGNATURE-
> ___
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>
> If you sign up for a new RT support contract before December 31, we'll take
> up to 20 percent off the price. This sale won't last long, so get in touch 
> today.
> Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
>
>
> Community help: http://wiki.bestpractical.com
> Commercial support: [EMAIL PROTECTED]
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


Re: [rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Kenneth Crocker

Matt,


	I believe Todd already offered to help you with your code. I do not 
think you are going to get any better help.



Kenn
LBNL

On 11/5/2007 10:31 AM, Matt Westfall wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I wish someone would please help me with this relatively simple task.  I
bought the RT Essentials book, and the only example it has is creating a
new ticket off of a straight Resolve with no conditions.

Can someone please help me with this!?!?!


I'm having the hardest time figuring out how to create a ticket based on
the status of a Custom Field.

I have two Custom Fields

1: Billable
It's a select one field with values of:
   Yes
   No
   Covered
   Gratis

2: Followup
 It's a select one field with values of:
Yes
No

I have the two corresponding scrips written:

1: Invoice

Condition: User Defined
Action: Create Tickets
Template: Generate-Invoice

Custom Condition:
return 0 unless $trans->Type eq "Resolve";

return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Yes/i);
return 1;
return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Gratis/i);
return 1;

return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Covered/i);
return 1;

2:

Condition: User Defined:
Action: Create Tickets:
Template: generate-followup

Custom Condition:

return 0 unless $trans->Type eq "Resolve";

return undef unless ($self->TicketObj->FirstCustomFieldValue('Followup')
=~ /Yes/i);
return 1;


I have two corresponding templates created:

1:
===Create-Ticket: generate-invoice
Queue:  Accounting
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: Please generate an invoice for this customer.
Billable was set to:
{$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable')}

Billable hours was set to:
{$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable Hours')}
Please refer to previous ticket for more information.
ENDOFCONTENT

2:
===Create-Ticket: generate-followup
Queue:  Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket.  Please refer to
previous ticket for more information.
ENDOFCONTENT


I then created a test ticket with Billable set to Yes and Followup to
Yes, and neither ticket spawned!!!

Help please!!!

Thanks in advance,
Matt Westfall
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHL2Fsb/8X6V5MpAURAvChAJ9qYhZYLRtY1dHQoXqNq48EXELcvACg5Wr6
rcHlWbl+i866n4Q3bimJE20=
=ZK86
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.



Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com



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

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch today. 
   Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.



Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com


[rt-users] [Fwd: Create Ticket but only if Custom Field is...]

2007-11-05 Thread Matt Westfall
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I wish someone would please help me with this relatively simple task.  I
bought the RT Essentials book, and the only example it has is creating a
new ticket off of a straight Resolve with no conditions.

Can someone please help me with this!?!?!


I'm having the hardest time figuring out how to create a ticket based on
the status of a Custom Field.

I have two Custom Fields

1: Billable
It's a select one field with values of:
   Yes
   No
   Covered
   Gratis

2: Followup
 It's a select one field with values of:
Yes
No

I have the two corresponding scrips written:

1: Invoice

Condition: User Defined
Action: Create Tickets
Template: Generate-Invoice

Custom Condition:
return 0 unless $trans->Type eq "Resolve";

return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Yes/i);
return 1;
return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Gratis/i);
return 1;

return undef unless
($self->TicketObj->FirstCustomFieldValue('Name_of_your_Custom_Field') =~
/Covered/i);
return 1;

2:

Condition: User Defined:
Action: Create Tickets:
Template: generate-followup

Custom Condition:

return 0 unless $trans->Type eq "Resolve";

return undef unless ($self->TicketObj->FirstCustomFieldValue('Followup')
=~ /Yes/i);
return 1;


I have two corresponding templates created:

1:
===Create-Ticket: generate-invoice
Queue:  Accounting
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: Please generate an invoice for this customer.
Billable was set to:
{$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable')}

Billable hours was set to:
{$Tickets}{'TOP'}->TicketObj->FirstCustomFieldValue('Billable Hours')}
Please refer to previous ticket for more information.
ENDOFCONTENT

2:
===Create-Ticket: generate-followup
Queue:  Customer Service
Subject: Invoice: { $Tickets{'TOP'} -> Subject() }
Requestor: {$Tickets{'TOP'}->OwnerObj->EmailAddress() }
RefersTo:  {$Tickets{'TOP'}->Id() }
Content: A follow up was requested on this ticket.  Please refer to
previous ticket for more information.
ENDOFCONTENT


I then created a test ticket with Billable set to Yes and Followup to
Yes, and neither ticket spawned!!!

Help please!!!

Thanks in advance,
Matt Westfall
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHL2Fsb/8X6V5MpAURAvChAJ9qYhZYLRtY1dHQoXqNq48EXELcvACg5Wr6
rcHlWbl+i866n4Q3bimJE20=
=ZK86
-END PGP SIGNATURE-
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch 
today. 
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.


Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com