Subject: | Ticket creation succeeds with invalid field values |
Hi,
I've noticed that ticket creation succeeds using
RT::Client::REST::Ticket even if some of the supplied fields are invalid.
Specifically, we have an "amount" field which doesn't accept -ve values.
If I try and create a ticket through the web UI it is rejected, but if I
do it through RT::Client::REST::Ticket, it succeeds, but with the
offending field empty.
This is a fragment of the code I'm using:
my $rt = RT::Client::REST->new(server =>
Storage::Config->RT_SERVER,
timeout => 30);
$rt->basic_auth_cb(
sub {
my ($realm, $uri, $proxy) = @_;
return (Storage::Config->RT_USER,
Storage::Config->RT_PASS);
}
);
my %rt_args = (rt => $rt,
queue => $args->{queue} ||
Storage::Config->RT_QUEUE,
subject => $args->{subject},
);
$rt_args{cf} = $args->{cf} if $args->{cf};
$rt_args{requestors} = $args->{requestors} if
$args->{requestors};
my $ticket = RT::Client::REST::Ticket->new(%rt_args);
$ticket->store(text => $args->{text});
$args->{cf} is set something like:
cf => {
amount => -12.53,
currency => 'GBP',
supplier => 'Acme Resellers',
}
It would be nice if creating a ticket over REST applied field validation.
I'm not sure if this is a RT-Client-REST problem or a general RT problem.