Mailing List Archive

Default owner
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
Re: Default owner [ In reply to ]
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
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>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: http://bestpractical.com/about/jobs.html
>


_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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: http://bestpractical.com/about/jobs.html
Re: Default owner [ In reply to ]
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
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> >
> >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:
> http://bestpractical.com/about/jobs.html
> >
>
>
>
Re: Default owner [ In reply to ]
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:

>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
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>_______________________________________________
>>>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>>>
>>>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:
>>>
>>>
>>http://bestpractical.com/about/jobs.html
>>
>>
>>
>>
>>
>
>
>


_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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: http://bestpractical.com/about/jobs.html
Re: default owner [ In reply to ]
Easiest way is with a scrip. The scrip below is one that my team uses. It’s slightly different than what you’re wanting, as it only acts if the creator is a member of our team; as the team is only three people, I’ve just hard coded the ids, but if you remove the return 1 unless ($actor==60 line, it’ll do what you want.


Steve Anderson


Scrip:

On create
User Defined
Global Template: Blank
Transaction Create
Custom Action preparation code: return 1;
Custom Action Cleanup code:

# get actor ID
my $Actor = $self->TransactionObj->Creator;

# if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;

# don't set owner unless requestor is a member of the network team
return 1 unless ($Actor == 60 || $Actor == 53802 || $Actor == 105200);


# 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;
}
$self->TicketObj->SetStatus('open');
return 1;






From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Ingo.Itter@ages.de
Sent: 15 October 2010 08:06
To: rt-users@lists.bestpractical.com
Subject: [rt-users] default owner


Hello List,


how can i set default owner to the value of the creator ?. The default setting is nobody


Thank you
_______________________________________________________________________
Geschäftsführer: Rolf Herzog, Thomas Benk
AGES Maut System GmbH & Co. KG
AG Düsseldorf HRA 14045, USt-IdNr.: DE 202525868
AGES International GmbH & Co. KG
AG Düsseldorf HRA 16636, USt-IdNr.: DE 813749831
AGES ETS GmbH
AG Düsseldorf HRB 55580, USt-IdNr.: DE 814789134
________________________________
This email has been scanned by Netintelligence
http://www.netintelligence.com/email
________________________________

________________________________
BiP Solutions Limited is a company registered in Scotland with Company
Number SC086146 and VAT number 383030966 and having its registered
office at Medius, 60 Pacific Quay, Glasgow, G51 1DZ.

****************************************************************************
This e-mail (and any attachment) is intended only for the attention of
the addressee(s). Its unauthorised use, disclosure, storage or copying
is not permitted. If you are not the intended recipient, please destroy
all copies and inform the sender by return e-mail.
This e-mail (whether you are the sender or the recipient) may be
monitored, recorded and retained by BiP Solutions Ltd.
E-mail monitoring/ blocking software may be used, and e-mail content may
be read at any time.You have a responsibility to ensure laws are not
broken when composing or forwarding e-mails and their contents.
****************************************************************************