[rt-users] Re: [Rt-devel] UserDefined scrip action
Jan Okrouhly
okrouhly at civ.zcu.cz
Tue Dec 14 07:35:50 EST 2004
On Thu, 9 Dec 2004, Andy Harrison wrote:
> > > But how would you determine the group to use? The requestor's group?
> > > The current user? The current queue (i.e. who has rights to it)?
> >
> > Anyway.
> > As I've written in my case it was I CustomField set on Tickets
> > which Value identifie the Group name -> Emails... This is not a core of
> > solved problem with my scrip codes.
> >
> > Jan Okrouhlý
Yes, here is one way how to do that:
use system scrip action Notify (with no Arguments) and then
put up code setting BCc,Cc either To to the very beginning of given
Template.
Ana another way is (I HOPE) to write custom action prepare code (inspired
in RT3.2.2 __Approvals' scrips) like:
----- cut here ----
package RT::Action::tmp;
require RT::Action::Notify;
use strict;
use vars qw/@ISA/;
@ISA=qw(RT::Action::Notify);
sub SetRecipients {
# Your Code preparing Bcc, To or whatever
@{$self->{'Bcc'}}=('i.e. some needed addresses at st.worldcomain');
}
bless($self, 'RT::Action::tmp');
return $self->Prepare;
--- cut here ---
> In that case, I see no reason you can't use Ruslan's NotifyGroup
> module. Since you probably have a finite amount of possible values in
> your custom field, you could create one scrip per value.
>
> Use a custom condition:
> # Create, or whatever condition.
> return undef unless ($self->TransactionObj->Type eq "Create");
> return undef if ($self->TicketObj->FirstCustomFieldValue('Your
> Custom Field Name') =~ /Value you're searching for/i);
> return 1;
>
> Choose the appropriate action generated by Ruslan's NotifyGroup.
> Template: TemplateForSomeValue1
>
> Then in the Template, just specify your cc at the very top line of the
> template (making sure to put an empty line after) and it should work.
>
>
> --
> 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-users
mailing list