[Rt-devel] UserDefined scrip action

Jan Okrouhly okrouhly at civ.zcu.cz
Thu Dec 9 11:18:35 EST 2004


On Thu, 9 Dec 2004, Andy Harrison wrote:

> On Thu, 9 Dec 2004 16:10:25 +0100 (CET), Jan Okrouhly
> <okrouhly at civ.zcu.cz> wrote:
> > Hello,
> >
> > we use RT 3.2.2 and meet big troubles with custom action scrips - it works
> > only sometimes (maybe just only once). This example for is i.e. not
> > working well if used in Scrip for specific Queue.
> > Is this approach wrong/where is the problem?
> > I (customer) doesn't want to use additional files like yours good one
> > Action/NotifyGroup.pm, because the LoadedGroup will change depending on
> > some ticket info (Customer CustomFields)...
> >
> > Prepare part:
>
> You're confusing Scrips with Scripts.  All of that belongs in a perl
> script, not in an RT Scrip.

But I do not want to add a Cc Watcher, I just want to send a specific
message (defined by Template) to specific "group" of recipients (nor Ccs
nor AdminCcs).

> Here's an example of how I add a Cc in a scrip.
>
> Description: AddWatcherCompanyX
> Condition: User Defined
>
> Custom condition:
> return undef unless ($self->TransactionObj->Type eq "Create");
> return undef if ($self->TicketObj->FirstCustomFieldValue('TicketMail')
> =~ /Internal/i);
> return undef unless ($self->TicketObj->FirstCustomFieldValue('Domain') =~
>  /CompanyX/i);
> return 1;
>
> Action: User Defined
> Custom action preparation code:
> my ($status, $msg) = $self->TicketObj->AddWatcher(Type => 'Cc', Email
> => "suscom-outage\@gwi.net" );
> return 1;
>
> Custom action cleanup code:
> return 1;
> Stage: TransactionCreate
> Template: Global template: Blank
>
>
> --
> Andy Harrison
>
>


Jan Okrouhlý

//------------------------------------\-\-\+\-\-\---okrouhly at civ.zcu.cz-\\
|Laboratory for Computer Science           |    phone: +420 377 632 837  |
|University of West Bohemia                | location: Univerzitni 22    |
|Americka 42, 306 14 Pilsen, Czech Republic|     room: UI402             |
+---------------------------------------73-!-de-OK1INC at OK0PPL.#BOH.CZE.EU+
|  Monday or Tuesday:                      |    phone: +420 224 355 263  |
 \\___________________CESNET z.s.p.o.______|_location: Zikova 4, Prague_//



More information about the Rt-devel mailing list