Re: [rt-users] Owner not showing in search results?

2016-11-18 Thread Sinapius, Vinzenz
Hi Alex,

What is the Format-String of your search? (It’s under the advanced tab, when 
you edit the search)

The scrip looks fine.

Cheers,
Vinzenz
Vinzenz Sinapius
Information Technology | Informationstechnik

tracetronic GmbH
Stuttgarter Str. 3
01189 DRESDEN
GERMANY

Phone: +49 351 205768-167
Fax: +49 351 205768-999
E-mail: vinzenz.sinap...@tracetronic.de

Head Office | Hauptsitz: Stuttgarter Str. 3, 01189 DRESDEN, GERMANY
Managing Directors | Geschäftsführer: Dr.-Ing. Rocco Deutschmann, Dr.-Ing. 
Peter Strähle
Registration Court | Registergericht: Amtsgericht Dresden, HRB 23 086


Von: rt-users [mailto:rt-users-boun...@lists.bestpractical.com] Im Auftrag von 
Alex Hall
Gesendet: Freitag, 18. November 2016 14:29
An: rt-users 
Betreff: [rt-users] Owner not showing in search results?

Hi all,
We have an odd problem. I've put a script in place that sets the requestor of a 
ticket to be its owner, and that works perfectly when viewing a ticket--the 
owner is shown as the requestor. The problem is that search results show most 
tickets as being owned by nobody, but if you click a ticket, you see the owner 
has actually been set as expected. It's just search results that don't want to 
show the owner.

I found this script on the Wiki, and don't know enough about RT's internals to 
say if it does everything it should. Does anyone see any possible problems with 
it that would cause the issue with search results?


# 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;
#prevents a ticket being assigned to an unprivileged user, comment out if you 
want this
return 1 unless $self->TransactionObj->CreatorObj->Privileged;
#get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
#try to change owner
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". 
$Actor );
my ($status, $msg) = $self->TicketObj->_Set(Field => 'Owner', Value => $Actor, 
RecordTransaction => 0);
unless( $status ) {
$RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
return undef;
}

return 1;

--
Alex Hall
Automatic Distributors, IT department
ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

Re: [rt-users] Owner not showing in search results?

2016-11-18 Thread Alex Hall
We always leave it at the default. I did a search for "queue:technology",
and here's the format it uses:

   '__id__/TITLE:#',
   '__Subject__/TITLE:Subject',
   Status,
   QueueName,
   Owner,
   Priority,
   '__NEWLINE__',
   '__NBSP__',
   '__Requestors__',
   '__CreatedRelative__',
   '__ToldRelative__',
   '__LastUpdatedRelative__',
   '__TimeLeft__'

On Fri, Nov 18, 2016 at 9:03 AM, Sinapius, Vinzenz <
vinzenz.sinap...@tracetronic.de> wrote:

> Hi Alex,
>
>
>
> What is the Format-String of your search? (It’s under the advanced tab,
> when you edit the search)
>
>
>
> The scrip looks fine.
>
>
>
> Cheers,
>
> Vinzenz
>
> Vinzenz Sinapius
> Information Technology | Informationstechnik
>
> *trace**tronic* GmbH
> Stuttgarter Str. 3
> 01189 DRESDEN
> GERMANY
>
> Phone: +49 351 205768-167
> Fax: +49 351 205768-999
> E-mail: vinzenz.sinap...@tracetronic.de
>
> Head Office | Hauptsitz: Stuttgarter Str. 3, 01189 DRESDEN, GERMANY
> Managing Directors | Geschäftsführer: Dr.-Ing. Rocco Deutschmann, Dr.-Ing.
> Peter Strähle
> Registration Court | Registergericht: Amtsgericht Dresden, HRB 23 086
>
>
>
> *Von:* rt-users [mailto:rt-users-boun...@lists.bestpractical.com] *Im
> Auftrag von *Alex Hall
> *Gesendet:* Freitag, 18. November 2016 14:29
> *An:* rt-users 
> *Betreff:* [rt-users] Owner not showing in search results?
>
>
>
> Hi all,
>
> We have an odd problem. I've put a script in place that sets the requestor
> of a ticket to be its owner, and that works perfectly when viewing a
> ticket--the owner is shown as the requestor. The problem is that search
> results show most tickets as being owned by nobody, but if you click a
> ticket, you see the owner has actually been set as expected. It's just
> search results that don't want to show the owner.
>
> I found this script on the Wiki, and don't know enough about RT's
> internals to say if it does everything it should. Does anyone see any
> possible problems with it that would cause the issue with search results?
>
>
> # 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;
> #prevents a ticket being assigned to an unprivileged user, comment out if
> you want this
> return 1 unless $self->TransactionObj->CreatorObj->Privileged;
> #get out unless ticket owner is nobody
> return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
> #try to change owner
> $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user
> #". $Actor );
> my ($status, $msg) = $self->TicketObj->_Set(Field => 'Owner', Value =>
> $Actor, RecordTransaction => 0);
> unless( $status ) {
> $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg"
> );
> return undef;
> }
>
> return 1;
>
>
> --
>
> Alex Hall
>
> Automatic Distributors, IT department
>
> ah...@autodist.com
>
> -
> RT 4.4 and RTIR training sessions, and a new workshop day!
> https://bestpractical.com/training
> * Los Angeles - January 9-11 2017
>



-- 
Alex Hall
Automatic Distributors, IT department
ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

[rt-users] Timezone set to GMT?

2016-11-18 Thread Alex Hall
Hi all,
I have the timezone set in SiteConfig how it came by default, and
/etc/timezone on my server is correct. Yet, I've just noticed that times in
RT are GMT, not Eastern like they should be. I only just noticed this, but
I'm told it has been an ongoing problem. That means I don't know what I
might have changed, or when.

Is there more to the timezone than letting RT pick it up from
/etc/timezone? Do I need to worry about setting MySQL somehow? The file is
644, so is readable by everyone. Thanks.

-- 
Alex Hall
Automatic Distributors, IT department
ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

Re: [rt-users] Timezone set to GMT?

2016-11-18 Thread Landon Stewart
On Nov 18, 2016, at 11:40 AM, Alex Hall 
> wrote:

Hi all,
I have the timezone set in SiteConfig how it came by default, and /etc/timezone 
on my server is correct. Yet, I've just noticed that times in RT are GMT, not 
Eastern like they should be. I only just noticed this, but I'm told it has been 
an ongoing problem. That means I don't know what I might have changed, or when.

Is there more to the timezone than letting RT pick it up from /etc/timezone? Do 
I need to worry about setting MySQL somehow? The file is 644, so is readable by 
everyone. Thanks.

This is probably already set in the shipped configuration in etc/RT_Config.pm 
as follows but you can override it in etc/RT_SiteConfig.pm

   $Timezone
   $Timezone is the default timezone, used to convert times entered by 
users into GMT, as they are stored in the database, and back again;
   users can override this.  It should be set to a timezone recognized 
by your server.

eg:
Set($Timezone, "US/Eastern");

--
Landon Stewart
Lead Analyst - Abuse and Security Management
INTERNAP ®
 lstew...@internap.com
 www.internap.com

-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017

[rt-users] Owner not showing in search results?

2016-11-18 Thread Alex Hall
Hi all,
We have an odd problem. I've put a script in place that sets the requestor
of a ticket to be its owner, and that works perfectly when viewing a
ticket--the owner is shown as the requestor. The problem is that search
results show most tickets as being owned by nobody, but if you click a
ticket, you see the owner has actually been set as expected. It's just
search results that don't want to show the owner.

I found this script on the Wiki, and don't know enough about RT's internals
to say if it does everything it should. Does anyone see any possible
problems with it that would cause the issue with search results?


# 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;
#prevents a ticket being assigned to an unprivileged user, comment out if
you want this
return 1 unless $self->TransactionObj->CreatorObj->Privileged;
#get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
#try to change owner
$RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user
#". $Actor );
my ($status, $msg) = $self->TicketObj->_Set(Field => 'Owner', Value =>
$Actor, RecordTransaction => 0);
unless( $status ) {
$RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
return undef;
}

return 1;

-- 
Alex Hall
Automatic Distributors, IT department
ah...@autodist.com
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - January 9-11 2017