[rt-users] Problem with making a custom scrip

Bart bart at pleh.info
Tue Jul 26 08:40:21 EDT 2011


Hi Robert,

Thanks for the reply, I've changed that setting but it doesn't seem to fully
solve my problem (I do notice a difference).

I've modified the scrip a little, it now looks like this:

my $my_type = $self->TicketObj->FirstCustomFieldValue('Type');
> if ($my_type =~ /^I/) { $self->TicketObj->AddCustomFieldValue(Field =>
> 'SLA', Value => 'Urgent'); };
> if ($my_type =~ /^C/) { $self->TicketObj->AddCustomFieldValue(Field =>
> 'SLA', Value => 'Normal'); };
> if ($my_type =~ /^P/) { $self->TicketObj->AddCustomFieldValue(Field =>
> 'SLA', Value => 'Low'); };


The first problem I have is that the SLA is already set to the value
"Normal", I see the scrip running but it keeps saying "Set SLA Low to
Normal" or similar for Urgent (normal is ignored). So I get a feeling it
does something, but it doesn't actually change the content of the SLA field.

Maybe it's the type of CF that the SLA field is, it's a dropbox with the
three options Urgent, Normal and Low. But I thought it shouldn't matter?!

The second problem is that if the SLA field is set to (no value) then the
scrip gives the error "Low is no longer a value for custom field SLA", which
could be the same issue as the first? Not able to fill the actual field?

Any thoughts on this? (the above code is a little different but I get the
same results as the first code)

Best regards,

Bart



2011/7/26 Robert Wysocki <robert.wysocki at contium.pl>

> Dnia 2011-07-26, wto o godzinie 10:22 +0200, Bart pisze:
> (...)
>
> >         my $my_type = $self->TicketObj->CustomFieldValues('Type');
>
> Use $self->TicketObj->FirstCustomFieldValue('Type') instead.
>
> Regards,
> --
> Robert Wysocki
> CONTIUM S.A., http://www.contium.pl
>
>
> --------
> 2011 Training: http://bestpractical.com/services/training.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110726/235acefc/attachment.htm>


More information about the rt-users mailing list