Hello,
In the Perl API, how do I get the names/values of all custom fields
attached to a ticket? I looked at the documentation, but I only see ways
to check for custom fields globally, not how to get a list of all the
custom fields that apply to a single ticket.
I am using 3.8.
Thanks!
On Tue, Nov 04, 2014 at 02:42:57PM +, Chris Down wrote:
Hello,
In the Perl API, how do I get the names/values of all custom fields
attached to a ticket? I looked at the documentation, but I only see
ways to check for custom fields globally, not how to get a list of
all the custom fields
Hi Emmanuel,
Thanks for your great reply!
Emmanuel Lacour writes:
my $CustomFields = $Ticket-CustomFields;
This works, but I don't see it documented here[0]. Is that expected?
[0]: https://www.bestpractical.com/docs/rt/3.8/RT/Ticket.html
while (my $CustomField = $CustomFields-Next) {
I think I eventually found what I want[0]:
$ticket-CustomFieldValuesAsString($custom_field_name);
However, on my version of RT this says:
RT::Ticket::CustomFieldValuesAsString Unimplemented in main. (rt-dump.pl line
91)
Any ideas? :-)
0:
On Tue, Nov 04, 2014 at 03:44:55PM +, Chris Down wrote:
I think I eventually found what I want[0]:
$ticket-CustomFieldValuesAsString($custom_field_name);
$ticket-FirstCustomFieldValue($custom_field_name);
looks what you're lookign for ;)
RT::Ticket is based on RT::Record, so you can
Emmanuel Lacour writes:
$ticket-FirstCustomFieldValue($custom_field_name);
Dude, that totally works! Thanks so much for your help, I owe you one!
pgpzWA9NU8ko8.pgp
Description: PGP signature
--
RT Training November 4 5 Los Angeles
http://bestpractical.com/training