[rt-users] Custom Fields and Templates
Ruslan U. Zakirov
cubic at acronis.ru
Tue Mar 2 12:57:37 EST 2004
You've forgot about custom fields with multiply values. It break your
indend, but not mine :)
Second 'while' specialy for this case.
Good luck. Ruslan.
Andy Harrison wrote:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> On Tue, 02 Mar 2004 19:43:22 +0300, Ruslan U. Zakirov wrote
> Subject: "Re: [rt-users] Custom Fields and Templates"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>>REPLY TO LIST TOO.
>>I'm not a BestPractical's support team member. :)
>
>
> Oops, that pesky Reply All button...
>
>
>>{
>> my $CustomFields = $Ticket->QueueObj->CustomFields();
>> while (my $CustomField = $CustomFields->Next()) {
>> my $CustomFieldValues=$Ticket->CustomFieldValues($CustomField->Id);
>>
>> if ($CustomFieldValues->Count) {
>> $OUT .= $CustomField->Name . ":\n";
>> } else {
>> next;
>> }
>>
>> while (my $CustomFieldValue = $CustomFieldValues->Next) {
>> $OUT .= "\t" . $CustomFieldValue->Content . "\n";
>> }
>> }
>> $OUT;
>>}
>>
>>What do you think about this??? :)
>> Best regards. Ruslan.
>
>
> Thanx a lot. Works like a champ.
>
> Here's my slightly modified finished product:
>
> {
> my $CustomFields = $Ticket->QueueObj->CustomFields();
> while (my $CustomField = $CustomFields->Next()) {
> my $CustomFieldValues=$Ticket->CustomFieldValues($CustomField->Id);
> $OUT .= $CustomField->Name;
> if ($CustomFieldValues->Count) {
> $OUT .= ":" . " " x (20 - length($CustomField->Name));
> } else {
> $OUT .= ":\n";
> next;
> }
> while (my $CustomFieldValue = $CustomFieldValues->Next) {
> $OUT .= $CustomFieldValue->Content . "\n";
> }
> }
> $OUT;
> }
>
> The hardcoded 20 for the length isn't very stylish, but I didn't feel
> like bothering doing it right. Future individuals who try this snippet
> will want to make sure it doesn't bite you if you have long CF names.
>
More information about the rt-users
mailing list