Subject: | Case Sensitivity |
Date: | Wed, 5 Jun 2013 08:40:45 -0700 |
To: | bug-RT-Client-REST [...] rt.cpan.org |
From: | "Timothy J. Wiley" <tjwiley [...] gmail.com> |
For quite a few years, a bug has existed in RT::Client::REST that
causes custom field not to be set upon ticket creation. It was
reported on cpanforum.com, but I'm pretty sure it was never reported
to any kind of bug tracker. I'm gonna be that guy that reports it to
you formally. Below is a decent description of what's going on.
From: http://cpanforum.com/threads/5808
---------------------------------------
"I don't know if this has been brought up, but I will continue with this post.
I have been working on a perl script which will create a ticket in RT
using REST. I started using RT::Client::REST 0.31. One of the
requirements was the ability populate custom fields on ticket
creation. Also needed the ticket to contain all the information it
needed from a form on ticket creation. I used RT::Client::REST->create
subroutine to create the ticket which was great as I could populate
all fields on creation, except for custom fields.
Why was this happening? Well, in REST.pm, it takes all the values
provided in the hash in the create subroutine and makes them all
lowercase. Custom fields need to start with "CF-" and in that case for
them to work."
---------------------------------------
And below I've even submitted a patch (to 0.43) to finally fix it.
Admittedly, I don't know if it will break anything else, it certainly
hasn't for us.
--- RT/Client/REST.pm.orig 2012-01-09 10:09:51.000000000 -0800
+++ RT/Client/REST.pm 2013-06-03 12:48:17.000000000 -0700
@@ -318,7 +318,7 @@
my %set;
if (defined(my $set = delete($opts{set}))) {
while (my ($k, $v) = each(%$set)) {
- vpush(\%set, lc($k), $v);
+ vpush(\%set, $k, $v);
}
}
if (defined(my $text = delete($opts{text}))) {