<DIV>Hi everyone,</DIV>
<DIV>I'm running RT 3.4.0 on debian linux 3.4 with perl 5.8.4, mysql 4.1.9, mod_perl 1 with apache 1.3 and i'm trying to find a way of retrieving a requestors name from the RT database. pls, is it possible to use sql statements in templates and if it is, can anyone be kind enough to help me with the code snippet. thanks in anticipation of your help. The template i'm given is shown below but the code isn't working.</DIV>
<DIV> </DIV>
<DIV><BR>===Create-Ticket: Need Approval<BR>{<BR>my $RequestorEmail = $Ticket->RequestorAddresses;<BR>SELECT DISTINCT <BR>Users.Name AS rName FROM USERS <BR>WHERE<BR>Users.EmailAddress=$RequestorEmail;</DIV>
<DIV>my $RequestorName =$record->rName<BR>}</DIV>
<DIV>Subject: Approval for {$Tickets{'TOP'}->Subject}<BR>Depended-On-By: {$Tickets{'TOP'}->Id}<BR>Type: approval<BR>Queue: Approvals<BR>Owner: {$RequestorName}<BR>Status: Open<BR>Content-Type: text/html<BR>Content: Your approval is requested for the ticket <BR>{$Tickets{"TOP"}->Id}: {$Tickets{"TOP"}->Subject}.</DIV>
<DIV><br><BR><br><BR>Please visit <a <BR>href="{$RT::WebURL}Approvals/Display.html?id={$Ticket->id+1}">{$RT::WebURL}Approvals/Display.html?id={$Ticket->id+1}</a> <BR>to approve or reject this ticket, or <a <BR>href="{$RT::WebURL}Approvals/">{$RT::WebURL}Approvals/</a> to <BR>batch-process all your pending approvals.</DIV>
<DIV><br><BR><br><BR>-------------------------------------------------------------------------<BR><br><BR><br><BR>{$Transaction->Content()}</DIV>
<DIV> </DIV>
<DIV>ENDOFCONTENT</DIV>
<DIV> </DIV>
<DIV>part of the error code i got is given below:</DIV>
<DIV> </DIV>
<DIV>ENDOFCONTENT<BR> (/opt/rt3/lib/RT/Action/CreateTickets.pm:952)<BR>[Thu Mar 3 22:07:56 2005] [debug]: Workflow: yielding<BR>Can't modify concatenation (.) or string in scalar assignment at template line 6, at EOF</DIV>
<DIV><BR>Subject: Approval for test<BR>Depended-On-By: 259<BR>Type: approval<BR>Queue: Approvals<BR>Owner:<BR>Status: Open<BR>Content-Type: text/html<BR>Content: Your approval is requested for the ticket<BR>259: test.</DIV>
<DIV><br><BR><br><BR>Please visit <a<BR>href="http://rt2.ipnxtelecoms.com:80/Approvals/Display.html?id=251"><A href="http://rt2.ipnxtelecoms.com:80/Approvals/Display.html?id=251">http://rt2.ipnxtelecoms.com:80/Approvals/Display.html?id=251</A></a><BR>to approve or reject this ticket, or <a<BR>href="http://rt2.ipnxtelecoms.com:80/Approvals/"><A href="http://rt2.ipnxtelecoms.com:80/Approvals/</">http://rt2.ipnxtelecoms.com:80/Approvals/</</A>a> to<BR>batch-process all your pending approvals.</DIV>
<DIV><br><BR><br><BR>-------------------------------------------------------------------------<BR><br><BR><br><BR>This transaction appears to have no content</DIV>
<DIV> </DIV>
<DIV>ENDOFCONTENT<BR> (/opt/rt3/lib/RT/Action/CreateTickets.pm:968)<BR>[Thu Mar 3 22:07:56 2005] [error]: Ticket creation failed: Can't modify concatenation (.) or string in scalar assignment at template line 6, at EOF<BR> (/opt/rt3/lib/RT/Action/CreateTickets.pm:971)<BR>[Thu Mar 3 22:07:56 2005] [warning]: Exiting subroutine via next at /opt/rt3/lib/RT/Action/CreateTickets.pm line 977.<BR> (/opt/rt3/lib/RT.pm:277)<BR>[Thu Mar 3 22:19:54 2005] [info]: Successful login for root from 10.50.1.107 (/opt/rt3/share/html/autohandler:197)<BR></DIV><p>Send instant messages to your online friends http://uk.messenger.yahoo.com