Extract custom fields from tickets using commandline


I was wondering if anyone had any advice on how to best, from the
command line, conduct a search for tickets that match a custom field
value (‘CF.{Invoiced Date}’ > ‘2008-04-03’) show values in a custom
field in matching tickets (‘CF.{Purchase Order Number}’).

The intention is to use a cron task to find all tickets, who’s invoiced
date was last month and get the purchase order numbers associated with
those tickets.

I can get ./rt to show me the tickets using: ./rt ls “Queue = ‘PSS
Projects’ AND ‘CF.{Invoicable Date}’ > ‘2008-03-31’” and adding a -l
will give me the pro-forma fields, but not the associated custom fields.

Any hints?