Custom Fields in Scripts and Templates

What is the correct syntax for inserting custom field data into scripts
and templates? We have a service queue with a custom field (type of
ticket = locate or repair).
So, I want to create a script to read the type of ticket then dispatch
an email with custom field data inserted in the email i.e. Service #
Account# etc.

Thanks,

David
System Admin
RNS

Start reading here:

http://wiki.bestpractical.com/view/OnCreateCheckCF
http://wiki.bestpractical.com/view/OnCreateCheckCF
http://wiki.bestpractical.com/view/DefaultCustomFieldValue
http://wiki.bestpractical.com/view/DefaultCustomFieldValue
http://wiki.bestpractical.com/view/CreatePriorityBasedOnCustomFieldValues
http://wiki.bestpractical.com/view/CreatePriorityBasedOnCustomFieldValues
http://wiki.bestpractical.com/view/AddCustomFieldsValuesToMail
http://wiki.bestpractical.com/view/AddCustomFieldsValuesToMail
http://wiki.bestpractical.com/view/AddCustomFieldstoTemplates

http://wiki.bestpractical.com/view/AddCustomFieldstoTemplatesThere are
more examples under: Contributions - Request Tracker Wiki

http://wiki.bestpractical.com/view/ContributionsHave fun.2010/8/11 Sysadmin Sysadmin@ruralnetwork.net

What is the correct syntax for inserting custom field data into scripts and
templates? We have a service queue with a custom field (type of ticket =
locate or repair).
So, I want to create a script to read the type of ticket then dispatch an
email with custom field data inserted in the email i.e. Service # Account#
etc.

Thanks,

David
System Admin
RNS
RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!

MFG

Torsten Brumm

http://www.brumm.me
http://www.elektrofeld.de

To “Whomever”,

I use this code for user-defined “conditions” on Transactions:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

if ($trans->Type eq ‘CustomField’)
{my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “Review Process”);
return 0 unless $cf->id;
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Review Complete-Approved”)
{
return 1;
}
}

return 0;

And I use this code for getting the value of a Custom Field from a ticket:

my $cf_value = $ticket->FirstCustomFieldValue(‘name of CF’);

And I use this code to get that same value into a Template:

QA Approved by: {$Ticket->FirstCustomFieldValue(‘QA Approver’)}

Hope this helps.

Kenn
LBNLOn Wed, Aug 11, 2010 at 12:08 PM, Sysadmin Sysadmin@ruralnetwork.netwrote:

What is the correct syntax for inserting custom field data into scripts and
templates? We have a service queue with a custom field (type of ticket =
locate or repair).
So, I want to create a script to read the type of ticket then dispatch an
email with custom field data inserted in the email i.e. Service # Account#
etc.

Thanks,

David
System Admin
RNS
RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year – Learn how to get the most out of RT!