[rt-users] Conditions in a template?

Ken Crocker kfcrocker at lbl.gov
Thu Sep 3 13:36:47 EDT 2009


testwreq,

Sounds to me like you might be better off creating your own "On Create 
Set Owner" scrip and in that scrip select a template that just gives out 
the results. That way you can code /your/ conditions to check current 
owner /before/ you modify it and send out the Email.

Kenn
LBNL

On 9/3/2009 10:29 AM, testwreq wreq wrote:
>
>  
>
> Dear RT Gurus,
>
> We have created cusomized "Auto Reply" templates for all the queues, 
> that overwrites the "Global Auto Reply" template. I am wondering if 
> anyone know of any documentation on customizing template with conditions?
>
>  
>
> Basically, the first few lines of my customized template is assigning 
> a owner 'A' to the queue, and it does not record the transaction.
>
>  
>
> This is fine when the request is generated via email. However, we are 
> coming accross a situation where users are generating request using 
> the 'Ticket Create Option' of the interface and want to assign the 
> ticket to another staff member.. i.e. oweber 'B'. The users are able 
> to select owner "B" from the interface, but because of our customized 
> template, the owner is written back as "A".
>
>  
>
> Is there a condition that I can use to check the previous value of "owner"
>
> prior to assigning owner "B"?
>
>  
>
> For Eaxmple, check if Field=>'owner' has a value,
>
>   if yes, keep the same value and set RecordTransaction=>0,  ELSE
>
>     give the value as 'B'  and set RecordTransaction=>0
>
>  
>
>  
>
> Any suggestions/hlp will be appreciated. Regards rq.
>
> ============= END ===========
>
>  
>
> {
>
> ### assigns owner but doesn't record transaction ### Note that $owner 
> needs to be the RT id for the owner object, ### not a name or e-mail 
> address.
>
> my $owner = '22';
>
> $Ticket->_Set(Field=>'Owner', Value=>$owner, RecordTransaction=>0); 
> $OUT .= ""; }
>
> Subject: AutoReply: {$Ticket->Subject}
>
>  
>
> This message has been automatically generated in response to the 
> creation of a trouble ticket regarding:
>
> {
>
>   if ($Ticket->Subject() eq '') {
>
>       $OUT .= "                 No Subject";
>
> }
>
> }
>
>       { $Ticket->Subject() }
>
>  
>
> A summary of which ...
>
> ===================
>
> {$Transaction->Content()}
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090903/50e4f61e/attachment.htm>


More information about the rt-users mailing list