[rt-users] Send Notify except if Owner Nobody?

Benjamin Weser weser at osp-dd.de
Mon Mar 3 11:13:43 EST 2008


Hi Jean-Sebastien,

I'd use two scrips in your case.
1)
Decription: Notify Group On New Unowned Ticket
Condition: UserDefined
Action: NotifyGroup using this Extension: 
http://search.cpan.org/~ruz/RT-Action-NotifyGroup/
Template: Notify Group On New Ticket

Custom Condition:
unless(  $self->TransactionObj->Type eq "Status"
      && $self->TransactionObj->Field eq "new" )
{
   return 0;
}
return 1;


2)
Description: Notify Owner On New Ticket
Condition: On Create
Action: Notify Owner
Template: Notify Owner

Keep in mind that no mails are sent if owner is Nobody so scrip #2 will 
only work if there's really an owner. But you may want to extend the 
first condition to look if the owner is Nobody. Otherwise the group will 
be informed in each case. But I'm too lazy to look for that code now 
too. Check the wiki at http://wiki.bestpractical.com/view/HomePage and 
the list at http://www.gossamer-threads.com/lists/rt/ too, they will 
become your best friends while using RT. ;)

I hope that helps a little bit.

Best,
Ben



Jean-Sebastien Morisset schrieb:
> Arg! This is really frustrating. Using examples found here and there, I
> tried this, but it doesn't work...
>
> ---BEGIN-TEMPLATE---
> {
>   my ($to, $for, $msg);
>   if ($Ticket->OwnerObj->Name eq "Nobody") {
>     $to = "support-unix at m-x.ca";
>   } else {
>     $to = $Ticket->OwnerObj->EmailAddress;
>     $for = " for ".$Ticket->OwnerObj->Name;
>   }
>   $msg .= To: $to\n";
>   $msg .= "Subject: $Ticket->QueueObj->Name() Queue $for:
> $Ticket->Subject()\n\n";
>   $msg =. "Ticket #$Ticket->id $for has been added to the
> $Ticket->QueueObj->Name() queue.\n";
>   $msg;
> }
>
> -> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
>
> {$Transaction->Content()}
> ---END-TEMPLATE---
>
> Does anyone see where the problem might be?...
>
> Thanks!
> js.
>
> On Mon, Mar 03, 2008 at 01:43:17PM +0000, Jean-Sebastien Morisset wrote:
>   
>> Hi everyone,
>>
>> I know there's a way to do this, but I'm still learning RT, so I don't
>> know exactly how to code this... I'd like to send an e-mail for a new
>> ticket to a group, if the owner is Nobody, and send it to the owner if
>> the owner is NOT Nobody. Right now I have a generic e-mail scrip...
>>
>> The scrip:
>>     On Create Send Email with template Added to Queue Email
>>
>> The template (Added to Queue Email):
>>     To: group-list at company.com
>>     Subject: {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
>>
>>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue.
>>
>>     -> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
>>
>>     {$Transaction->Content()}
>>
>>
>> So I guess I'm looking to change the template to something like:
>>
>> ---BEGIN---
>> if owner eq Nobody {
>>     To: group-list at company.com
>>     Subject: {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
>>
>>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue.
>> } else {
>>     To: owner->email
>>     Subject: Your Ticket in {$Ticket->QueueObj->Name()} Queue: {$Ticket->Subject()}
>>
>>     Ticket #{$Ticket->id} has been added to the {$Ticket->QueueObj->Name()} queue and assigned to you.
>> }
>>
>> -> Ticket URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
>>
>> {$Transaction->Content()}
>> ---BEGIN---
>>
>> What do you think?
>>
>> Thanks!
>> js.
>> -- 
>> Jean-Sebastien Morisset, Sr. UNIX Administrator <jsmoriss at mvlan.net>
>> 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