Viewing custom fields via REST

I am using the RT::Client::REST modules but the code for accessing custom fields no longer works. I think this is because some change was made to RT in the last year and the REST code hasn’t been updated since then.

CPAN says that I should be able to view my custom fields via this command but it is not working:

Get a list of ticket’s custom field names:

my @custom_fields = $ticket->cf;

I am able to access the ticket okay – here is a partial dump of it:

$VAR1 = bless( {
’_admin_cc’ => [],
’_creator’ => ‘jsweeny’,
’_created’ => ‘Fri Nov 19 21:56:23 2010’,
’_time_worked’ => ‘’,
’_id’ => ‘REDACTED’,
’_status’ => ‘open’,
’_priority’ => ‘’,
’_initial_priority’ => ‘’,
’_subject’ => ‘REDACTED’,
’_due’ => undef,
’_time_estimated’ => ‘’,
’_time_left’ => ‘’,
’_queue’ => ‘General’,
’_cc’ => [],
’__dirty’ => {},
’_resolved’ => undef,
’_starts’ => undef,

Any ideas? Thanks,

~Jonny Sweeny, GSEC, GCWN, GCIH, GWAS
Incident Response Manager, Lead Security Analyst
Office of the VP for Information Technology, Indiana University
PGP & S/MIME: http://informationsecurity.iu.edu/Jonny_Sweeny
jsweeny@iu.edu – phone: (812) 855-4194 – fax: (812) 856-1011

I am using the RT::Client::REST modules but the code for accessing custom fields no longer works. I think this is because some change was made to RT in the last year and the REST code hasn’t been updated since then.

CPAN says that I should be able to view my custom fields via this command but it is not working:

Get a list of ticket’s custom field names:

my @custom_fields = $ticket->cf;

You can start trying to fix this by using bin/rt and RTDEBUG=3
to compare what bin/rt is sending over the wire and what
RT::Client::REST is sending over the wire.

-kevin

I assume RTDEBUG is an environmental variable I can set in perl using $ENV{RTDEBUG}, but I’m not sure what you mean by “bin/rt”. What is that referring to? The CLI?

~Jonny Sweeny, GSEC, GCWN, GCIH, GWAS
Incident Response Manager, Lead Security Analyst
Office of the VP for Information Technology, Indiana University
PGP & S/MIME: http://informationsecurity.iu.edu/Jonny_Sweeny
jsweeny@iu.edu – phone: (812) 855-4194 – fax: (812) 856-1011From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kevin Falcone
Sent: Monday, December 06, 2010 13:48
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] viewing custom fields via REST

I am using the RT::Client::REST modules but the code for accessing custom fields no longer works. I think this is because some change was made to RT in the last year and the REST code hasn’t been updated since then.

CPAN says that I should be able to view my custom fields via this command but it is not working:

Get a list of ticket’s custom field names:

my @custom_fields = $ticket->cf;

You can start trying to fix this by using bin/rt and RTDEBUG=3
to compare what bin/rt is sending over the wire and what
RT::Client::REST is sending over the wire.

-kevin

I am able to access the ticket okay – here is a partial dump of it:

$VAR1 = bless( {
’_admin_cc’ => [],
’_creator’ => ‘jsweeny’,
’_created’ => ‘Fri Nov 19 21:56:23 2010’,
’_time_worked’ => ‘’,
’_id’ => ‘REDACTED’,
’_status’ => ‘open’,
’_priority’ => ‘’,
’_initial_priority’ => ‘’,
’_subject’ => ‘REDACTED’,
’_due’ => undef,
’_time_estimated’ => ‘’,
’_time_left’ => ‘’,
’_queue’ => ‘General’,
’_cc’ => [],
’__dirty’ => {},
’_resolved’ => undef,
’_starts’ => undef,

Any ideas? Thanks,

I assume RTDEBUG is an environmental variable I can set in perl using $ENV{RTDEBUG}, but I’m not sure what you mean by “bin/rt”. What is that referring to? The CLI?

Yes, /opt/rt3/bin/rt, the command line client that uses REST
If it can see the data but RT::Client::REST can’t, then it points to a
bug in the perl module. If neither can see it, then it may be a bug in
your configuration.

-kevin