On Mon, 2010-03-08 at 14:29 -0500, Jason A. Smith wrote:
> 
> I am trying to get the scrip to not notify anyone when the ticket is
> automatically moved to a different queue, which is easy, but if the
> ticket is not moved, it should notify the AdminCcs, just like normal.
> What code in a Scrip will duplicate that default notify action?

I tried looking through the RT code to see if I could duplicate the
built-in notify admincc action, and came up with this custom action prep
scrip:

my $ScripActionObj = $self->ScripActionObj;
$ScripActionObj->Load('Notify', $self->TemplateObj->Id);
$ScripActionObj->SetExecModule('Notify');
$ScripActionObj->SetArgument('AdminCc');
$ScripActionObj->LoadAction(TransactionObj => $self->TransactionObj,
                            TicketObj => $self->TicketObj);
return($ScripActionObj->Prepare);

but it doesn't work right.  When I test it I get a message like this in
my RT logs:

RT: Scrip Commit 4 died. - Can't call method "id" on an undefined value
at /usr/lib/perl5/vendor_perl/5.8.8/RT/Action/SendEmail.pm line 300.
Stack: ....

Any ideas on what I am doing wrong and how I can get it to work
correctly?

Thanks,
~Jason


-- 
/------------------------------------------------------------------\
|  Jason A. Smith                          Email:  [email protected] |
|  Atlas Computing Facility, Bldg. 510M    Phone: +1-631-344-4226  |
|  Brookhaven National Lab, P.O. Box 5000  Fax:   +1-631-344-7616  |
|  Upton, NY 11973-5000,  U.S.A.                                   |
\------------------------------------------------------------------/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Community help: http://wiki.bestpractical.com
Commercial support: [email protected]

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

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

Reply via email to