AW: [rt-users] Simple Question: CustomField of Type SelectOneValue /How to get the Description from a Scrip/Template?

Kenneth Crocker KFCrocker at lbl.gov
Wed Jan 23 13:08:53 EST 2008


Ham & Torsten,


	I just caught the tail-end of your inquiry. If I understand your 
dilema, you are trying to get a CF called description into your 
notification template? If so, we use the following code that works quite 
well for us:

Subject: Request Titled: "{$Ticket->Subject}" has been resolved!

This ticket has been resolved. DO NOT reply to this message!
-----------------------------------------------------------------------------
TICKET INFORMATION:
Ticket Queue  : {$Ticket->QueueObj->Name}
Ticket Number : {$Ticket->Id}
Ticket Subject: {$Ticket->Subject}
Ticket Description:
      {
      return $Ticket->FirstCustomFieldValue('Description');
      }
Ticket Priority is: {$Ticket->Priority}
Ticket Created  by: {$Ticket->CreatorObj->Name}
Ticket Created  on: {substr($Ticket->Created, 0, 10)}
Ticket  Owned   by: {$Ticket->OwnerObj->Name}
Development Started on: {substr($Ticket->Started, 0, 10)}
QA Approved on: N/A
QA Approved by: N/A
Migrated    on: {substr($Ticket->Resolved, 0, 10)}
Migrated    by: {$Ticket->LastUpdatedByObj->Name}
Resolution comment:
{
       my $Resolution_Comment;
       my $Transactions;
       my $CommentObj;

       $Transactions = $Ticket->Transactions;
       $Transactions->Limit( FIELD => 'Type', VALUE => 'Comment' );
       $Transactions->OrderByCols(
           { FIELD => 'Created',  ORDER => 'DESC' },
           { FIELD => 'id',     ORDER => 'DESC' },
           );

       $CommentObj = $Transactions->First;

       if  ($CommentObj && $CommentObj->id)
       {
            $Resolution_Comment = $CommentObj->Content;
       }
       else
       {
            $Resolution_Comment = "No comment."
       }

       return $Resolution_Comment;
}
-----------------------------------------------------------------------------
To view ticket information, enter URL:

     {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}


	Please notice we pick up two different comments in the template and use 
two different styles as well. We use this as a model for grabbing CF's 
for a template. Anyway, hope this helps.


Kenn
LBNL

On 1/21/2008 7:34 AM, Ham MI-ID, Torsten Brumm wrote:
> ;-) OK, then i have to go the hard way....but hopefully jesse or one of the RT developers read this mails ;-)
> 
> Thanks
> 
> Torsten 
> 
>> Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Uwe Bielang (Stellv.), Bruno Mang, Alfred Manke, Thorsten Meincke, Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn (Stellv.), Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/Luxemburg Geschäftsführender Verwaltungsrat: Klaus-Michael Kühne
> 
> 
> -----Ursprüngliche Nachricht-----
>> Von: Emmanuel Lacour [mailto:elacour at easter-eggs.com] 
>> Gesendet: Montag, 21. Januar 2008 16:23
>> An: Ham MI-ID, Torsten Brumm
>> Cc: rt-users at lists.bestpractical.com
>> Betreff: Re: [rt-users] Simple Question: CustomField of Type 
>> SelectOneValue /How to get the Description from a Scrip/Template?
>>
>> On Mon, Jan 21, 2008 at 03:40:08PM +0100, Ham MI-ID, Torsten 
>> Brumm wrote:
>>> Shame on me... :-(
>>>
>>> Tryed it out with this (re read your Mail ;-) !)
>>>
>>> To: {$Ticket->CustomFieldValues('Occured in 
>>> Module')->First->Description;}
>>> Subject: {$Ticket->Subject}
>>>
>>> A new ticket has been created in queue HAM.WEBDEV.KNLOGIN.SUPPORT.
>>>
>>> {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
>>>
>>> -------------
>>>
>>> {$Transaction->Content()}
>>>
>>> And i get this error now :-(
>>>
>>> Jan 21 14:38:14 bruchtal-www3 RT: Template parsing error: 
>>> RT::ObjectCustomFieldValue::Description Unimplemented
>>>
>> Argh, it seems that we don't have access to description in 
>> this kind of object (RT::ObjectCustomFieldValue) :(
>>
>> No more idea :-/
>>
>> --
>> Emmanuel Lacour
>>
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 




More information about the rt-users mailing list