Copying CustomFields in templates

Hello,

I’ve been copying custom fields from one ticket to a new one in a
template as below:

CustomField-41: {$Tickets{‘TOP’}->CustomFieldValues(36)->Next()->Content}

Unfortunately this fails if the custom field is not set. I assume Next()
returns the Perl equivalent of null and then the call to “Content” fails.

Can anyone tell me how I can change my code snippet to simply return an
empty string if the custom field is undefined?

Thanks,
Graeme

Graeme Pyle wrote:

CustomField-41: {$Tickets{‘TOP’}->CustomFieldValues(36)->Next()->Content}

Unfortunately this fails if the custom field is not set. I assume Next()
returns the Perl equivalent of null and then the call to “Content” fails.

The bit in the {} is perl. A suitable conditional in there should
sort you out.
Phil Homewood, Systems Janitor, http://www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances