How to notify a user that their ticket has been stolen?

Hi all,

I have finally managed to get e-mail sent to notify a user if the
ticket has been assigned to them. I am not sure why, but the inbuilt “On
Owner Change” does not work, so I created a “User defined” condition
with the following:

If the field being changed in this transaction is ‘Owner’

then fire off this scrip.

if ($self->TransactionObj->Field eq ‘Owner’) {
return(1);
} else {
return(undef);
}

The Action is then “Notify Owner”, the problem, is that this only
notifies the new owner, and not the old owner. This means that if
the ticket is stolen, then the old owner is not notified of that.

Does anyone know how to fix that?

Also, on a related note; I am using the Template “Global template:
Owner Change” which I have slightly modified, the contents are:

{$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.

  Ticket: {$Ticket->id}

Transaction: {$Transaction->Description}
Queue: {$Ticket->QueueObj->Name}
subject given)"}
Owner: {$Ticket->OwnerObj->Name}
Old Owner: {$Transaction->OldValue}
Requestors: {$Ticket->RequestorAddresses}
Status: {$Ticket->Status}
Ticket: <{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}>
{$Transaction->Content()}

The problem is that the “Old Owner” is always a number… how do I
convert that number back into a user name?

Cheers,
Paul

Hi Paul,

  • pwagland@allshare.nl (Paul Wagland) [Thu 06 May 2004, 11:17 CEST]:
    […]

The problem is that the “Old Owner” is always a number… how do I
convert that number back into a user name?

I used this code in the template:

Old Owner: {my $user = new RT::User($RT::SystemUser);
$user->Load($Transaction->OldValue); $user->Name ||
$Transaction->OldValue}

I think you can use the same trick (using $user->EmailAddress) to have a
copy sent to the old requestor, just add e.g. a Bcc: line to the template
header section.

Regards,

-- Niels.