[rt-users] SCRIP User Defined Actions
Jeff Klassen
jklassen at biblesociety.ca
Fri Oct 24 09:48:16 EDT 2003
Hi Ruslan,
I am sorry. You have been quite helpful and clearly I should have sent more
detail already.
Here is a cat from the rt.log (debug), beginning with the [error] concerning
the scrip:
[Fri Oct 24 13:22:54 2003] [info]:
<rt-3.0.0-3127-14570.1.7426869282744 at ubs-translations.org> sent To: Cc:
Bcc: <email_address>@ubs-translations.org
(/usr/local/rt3/lib/RT/Action/SendEmail.pm:205)
[Fri Oct 24 13:22:54 2003] [error]: Scrip 36 Commit failed: No such
CustomField 'Region' at (eval 1516) line 5.
Stack:
[/usr/local/perl5.6.1/lib/site_perl/5.6.1/HTML/Mason/Request.pm:281]
[(eval 1516):5]
[/usr/local/rt3/lib/RT/ScripAction_Overlay.pm:192]
[/usr/local/rt3/lib/RT/Scrip_Overlay.pm:405]
[/usr/local/rt3/lib/RT/Scrip_Overlay.pm:344]
[/usr/local/rt3/lib/RT/Transaction_Overlay.pm:168]
[/usr/local/rt3/lib/RT/Ticket_Overlay.pm:3715]
[/usr/local/rt3/lib/RT/Ticket_Overlay.pm:578]
[/usr/local/rt3/lib/RT/Interface/Web.pm:285]
[/usr/local/rt3/share/html/Ticket/Display.html:70]
[/usr/local/rt3/share/html/Ticket/Create.html:242]
[/usr/local/rt3/share/html/autohandler:145]
(/usr/local/rt3/lib/RT/Action/UserDefined.pm:59)
[Fri Oct 24 13:22:54 2003] [info]: RT::Scrip=HASH(0x91ee76c): Couldn't
commit User Defined (/usr/local/rt3/lib/RT/Scrip_Overlay.pm:345)
[Fri Oct 24 13:22:54 2003] [info]: Ticket 3127 created in queue 'support_em'
by jklassen (/usr/local/rt3/lib/RT/Ticket_Overlay.pm:589)
Under our Global configuration there is in fact a custom field named
"Region" with type "Select one value" (there are 6 values).
The help is very much appreciated.
Jeff
> -----Original Message-----
> From: Ruslan U. Zakirov [mailto:cubic at acronis.ru]
> Sent: October 24, 2003 3:37 AM
> To: Jeff Klassen
> Cc: RT Users Discussion List
> Subject: Re: [rt-users] SCRIP User Defined Actions
>
>
> I've tested it. Could you provide a cat from rt.log when you create
> ticket in this queue? There is must be info about error!
> Next time provide debug info at once.
> I've tried to help you, but you don't want setup logging and just cat
> some strings from. You just say: "It's don't work."
>
> Jeff Klassen wrote:
> > Ruslan, others,
> >
> > I now have the following scrip set up for a queue in our RT
> > installation called 'support_em'
> >
> > Description: Set region field
> > Condition: On Create
> > Custom Condition: <none>
> > Action: User Defined
> > Custom action preparation code:
> > return 1;
> > Custom action cleanup code:
> > my $cf_name = 'Region';
> > my $cf = RT::CustomField->new($RT::SystemUser);
> > $cf->LoadByNameAndQueue(Name => $cf_name,
> > Queue => $self->TicketObj->Queue);
> > die "No such CustomField '$cf_name'" unless($cf->id);
> > my ($status, $msg) =
> > $self->TicketObj->RT::Ticket::AddCustomFieldValue(
> Why there is RT::Ticket::AddCustomFieldValue? I didn't send
> you such string! It must be: my ($status, $msg) =
> $self->TicketObj->AddCustomFieldValue(
> or
> my ($status, $msg) = $self->TicketObj->_AddCustomFieldValue(
> > Field => $cf,
> > Value => 'UBS Europe/Middle East',
> > RecordTransaction => 0
> > );
> > die $msg unless ($status);
> > return 1;
> > Template: Global template: Blank
> >
> > What I would like to happen is for an email sent in to this
> queue to
> > automatically have the custom field "Region" set to "UBS
> Europe/Middle
> > East". Ruslan has provided the code above, but this still does not
> > work. Can anyone spot a problem here?
> >
> > Thanks a lot everyone.
> >
> > Jeff
>
>
>
>
>
More information about the rt-users
mailing list