Skipping Owner Change Notification on newly created tickets

Hi All

I have a scrip which automatically changes the owner from “Nobody” to
another user when a new ticket is created in that queue, i.e it sets the
default queue owner. Normally, the stock-standard
notify-on-queue-owner-change scrip that runs after it would notify the new
owner of the ticket allocation. My question is:
Is there a way to turn off this notification to the default owner of the
queue in this specific case, (i.e only when ticket has been assigned it’s
default owner from previously being owned by Nobody?). And, can this be done
without breaking future upgrades of the RT3 installation?

Thanks in Advance,
Traiano Welcome

There is no Spoon.

Hi Traiano,

You can set the new owner without recording the transaction. If the
transaction doesn’t get recorded then it can’t trigger any scrips.

$Ticket->_Set(Field=>‘Owner’, Value=>$newowner, RecordTransaction=>0);

Regards,
Gene

At 02:48 AM 8/29/2008, Traiano Welcome wrote:

Hi All

I have a scrip which automatically changes the owner from “Nobody” to
another user when a new ticket is created in that queue, i.e it sets the
default queue owner. Normally, the stock-standard
notify-on-queue-owner-change scrip that runs after it would notify the new
owner of the ticket allocation. My question is:
Is there a way to turn off this notification to the default owner of the
queue in this specific case, (i.e only when ticket has been assigned it’s
default owner from previously being owned by Nobody?). And, can this be
done without breaking future upgrades of the RT3 installation?

Thanks in Advance,
Traiano Welcome

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Hi Gene

Thanks for the response. Where would be the best place to make this
modification? Looking at the code in “Ticket_Overlay.pm” I can’t seem to
spot how best to integrate it.

Also, how would I implement this in the scrip. For reference, my custom
cleanup code looks as follows (copied almost verbatim from the bestpractical
wiki article to set default owner on ticket create"):

my $MyUser = “traiano”;
my $QueueName = “Test”;
return 1 unless $self->TicketObj->QueueObj->Name eq $QueueName;
my $Actor = $self->TransactionObj->Creator;
return 1 if $Actor == $RT::SystemUser->id;
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
$RT::Logger->info(“Auto assigning ticket #”. $self->TicketObj->id ." to user
$MyUser" );
my ($status, $msg) = $self->TicketObj->SetOwner( $MyUser );
unless( $status ) {
$RT::Logger->warning( “Impossible to assign the ticket to $MyUser: $msg”
);
return undef;
}
1;

Many Thanks,
TraianoOn Fri, Aug 29, 2008 at 5:12 PM, Gene LeDuc gleduc@mail.sdsu.edu wrote:

Hi Traiano,

You can set the new owner without recording the transaction. If the
transaction doesn’t get recorded then it can’t trigger any scrips.

$Ticket->_Set(Field=>‘Owner’, Value=>$newowner, RecordTransaction=>0);

Regards,
Gene

At 02:48 AM 8/29/2008, Traiano Welcome wrote:

Hi All

I have a scrip which automatically changes the owner from “Nobody” to
another user when a new ticket is created in that queue, i.e it sets the
default queue owner. Normally, the stock-standard
notify-on-queue-owner-change scrip that runs after it would notify the new
owner of the ticket allocation. My question is:
Is there a way to turn off this notification to the default owner of the
queue in this specific case, (i.e only when ticket has been assigned it’s
default owner from previously being owned by Nobody?). And, can this be done
without breaking future upgrades of the RT3 installation?

Thanks in Advance,
Traiano Welcome


Gene LeDuc, GSEC
Security Analyst
San Diego State University

There is no Spoon.