[rt-users] SCRIP User Defined Actions

Ruslan U. Zakirov cubic at acronis.ru
Fri Oct 24 03:36:40 EDT 2003


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