Default owner

Hi,

When creating a ticket with quick ticket creation, the logged in user is
set as the owner by default. But - when going the “right” way through
"create ticket", the default owner is always “Nobody”. Is it possible to
make the default owner be the logged in user there as well?

regards,
Espen Tagestad

Espen,

Look at callbacks in Elements/SelectOwner file.On Thu, Sep 10, 2009 at 4:07 PM, Espen Tagestadespent@totem.fix.no wrote:

Hi,

When creating a ticket with quick ticket creation, the logged in user is
set as the owner by default. But - when going the “right” way through
“create ticket”, the default owner is always “Nobody”. Is it possible to
make the default owner be the logged in user there as well?

regards,
Espen Tagestad


List info: The rt-devel Archives

Best regards, Ruslan.

I want a certain support engineer to be the default owner of all tickets
created in a certain queue. I have tried doing this using scrips (on create
set owner to the specific rt user). The tickets, however. remain unowned and
no errors are displayed.

$self->TicketObj->owner eq ‘engineer’;

Is there another way to set the default owner on a certain queue and if not,
what is wrong with my scrip?

thanks in advance

Try this on for size.

Add this scrip to the queue you want.

Condition: OnCreate
Template: Blank
Action: UserDefined
---------------------------------------------BEGIN
SCRIP------------------------------------

get actor ID

#my $Actor = $self->TransactionObj->Creator;
#Set $Actor below to user you want to auto set to.
my $Actor = “Username”;

if actor is RT_SystemUser then get out of here

#return 1 if $Actor == $RT::SystemUser->id;

get out unless ticket owner is nobody

#return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

ok, try to change owner

$RT::Logger->info(“Auto assign ticket #”. $self->TicketObj->id ." to
user #". $Actor );
my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
$RT::Logger->error( “Impossible to assign the ticket to $Actor: $msg” );
return undef;
}
return 1;

----------------------------------END
SCRIP---------------------------------------------------------

Mustafa Badawi wrote:

didn’t work for me, tickets are still unowned. anywhere I can debug?On 4/6/06, Jason Fenner jfenner@vitamix.com wrote:

Try this on for size.

Add this scrip to the queue you want.

Condition: OnCreate
Template: Blank
Action: UserDefined
---------------------------------------------BEGIN
SCRIP------------------------------------

get actor ID

#my $Actor = $self->TransactionObj->Creator;
#Set $Actor below to user you want to auto set to.
my $Actor = “Username”;

if actor is RT_SystemUser then get out of here

#return 1 if $Actor == $RT::SystemUser->id;

get out unless ticket owner is nobody

#return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

ok, try to change owner

$RT::Logger->info(“Auto assign ticket #”. $self->TicketObj->id ." to
user #". $Actor );
my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
$RT::Logger->error( “Impossible to assign the ticket to $Actor: $msg”
);
return undef;
}
return 1;

----------------------------------END
SCRIP---------------------------------------------------------

Mustafa Badawi wrote:

I want a certain support engineer to be the default owner of all tickets
created in a certain queue. I have tried doing this using scrips (on
create
set owner to the specific rt user). The tickets, however. remain unowned
and
no errors are displayed.

$self->TicketObj->owner eq ‘engineer’;

Is there another way to set the default owner on a certain queue and if
not,
what is wrong with my scrip?

thanks in advance



The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

We’re hiring! Come hack Perl for Best Practical:
Careers — Best Practical Solutions

Some more details:

Set Custom action preparation code: to say return 1;
Put the code I sent to you in:
Custom action cleanup code

For debug information check your rt log file. This is normally located
in: /var/logs/rt/rt.log

Also, quit CCing rt-list-owners every time you post to the list.

Mustafa Badawi wrote: