[rt-users] Set Subject in if/then clause

Gerard FENELON gerard at eve-team.com
Wed Feb 1 08:30:59 EST 2012


Try something like

Subject: { if ($Ticket->QueueObj->Name eq 'Work Queue')
{ "Helpdesk Job Logged: {$Ticket->Subject} Output this"; }
elsif ($Ticket->QueueObj->Name eq 'Task Queue')
{ "Support Job Logged: {$Ticket->Subject} Output that"; }
else
{ "Output other"; }
}

In other words, your perl script should return a string.

Gerard

On 2012-02-01 14:18, Giuseppe Sollazzo wrote:
> On 01/02/12 13:08, Gerard FENELON wrote:
>> Hi Giuseppe
>>
>> what is your definition of "This doesn't seem to work" ? what is
>> the (bad) behaviour that you are seeing ? Does an email get sent or
>> not ? What is its subject line and content ? Anything in the logs
>> ?
>>
>> Gerard
> Hi Gerard,
>
> I should have been clearer but I thought it was evident: the "Subject"
> line is not valid Perl, so you can't compile a script built that way.
>
> The question is if there's a standard way to add that directive (a
> non-Perl one) within the if-clause.
>
> Thanks,
> Giuseppe
>
>> On 2012-02-01 12:03, Giuseppe Sollazzo wrote:
>>> Hi, I'm trying to set up a different subject for different queues
>>> in the same template (autoreply). This doesn't seem to work:
>>>
>>> { if ($Ticket->QueueObj->Name eq 'Work Queue') { Subject:
>>> Helpdesk Job Logged: {$Ticket->Subject} "Output this"; } elsif
>>> ($Ticket->QueueObj->Name eq 'Task Queue') { Subject: Support Job
>>> Logged: {$Ticket->Subject} "Output that"; } else { "Output
>>> other"; } }
>>>
>>> Is there a way to get this work?
>>>
>>> Thanks, Giuseppe



More information about the rt-users mailing list