Re: [rt-users] TimeTaken shows 0 minutes instead of 15 mins

2013-02-11 Thread Stuart Browne
Asif,

> mysql> select TimeTaken from Transactions where id = 7391416;

> 
> mysql> select TimeWorked from Tickets where id = 1188802;

> 
> Transaction 7391416 is part of the Ticket 1188802 where the time
> worked was 15 mins.
> 
> What gives?
> 
> Using RT  3.8.2 with mysql 5.0.75

It depends on what actions were taken during the transaction.

If time was entered during the ticket creation, the TimeTaken value is filled 
in.

If a comment or such was entered and time was entered against the action, it is 
created as TimeWorked with an NewValue / TimeWorked.

To work out how much time a given transaction took, you need to do some math, 
(MySQL SQL follows):

SELECT
SUM(Transactions.TimeTaken) + SUM(
IF(Transactions.OldValue != Transactions.NewValue,
Transactions.NewValue - Transactions.OldValue,
0)
   ) AS TimeWorked
FROM
Transactions
WHERE
Field  = 'TimeWorked'
AND ObjectType = 'RT::Ticket
AND ObjectId   = 1188802;

Adds all the TimeTaken values to the differences in OldValue and NewValue on 
TimeWorked for a given ticket.

Stuart


-- 
Help improve RT by taking our user survey: 
https://www.surveymonkey.com/s/N23JW9T


[rt-users] Sorry again

2012-06-28 Thread Stuart Browne
That's twice in as many days.  Time to tweak my aliases I think.

Sorry.

Stuart J. Browne
Senior Unix Administrator, Network Administrator, Database Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain privileged and/or 
confidential information. If you are not an intended recipient you must not 
use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.




[rt-users] Previous email - apologies

2012-06-26 Thread Stuart Browne
Sorry about that, sent to the wrong local alias..

Stuart J. Browne
Senior Unix Administrator, Network Administrator, Database Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain privileged and/or 
confidential information. If you are not an intended recipient you must not 
use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.




[rt-users] [ausregistry.net.au #104306] (Waiting on Customer) Case #00666204 (RHN TRACEBACK generated) ref:00DA0000000HxWHMA0.500A000000A5zZcIAJ:ref

2012-06-26 Thread Stuart Browne


-Original Message-
From: Red Hat Support [mailto:supp...@redhat.com] 
Sent: Tuesday, 26 June 2012 9:45 PM
To: Stuart Browne
Subject: (Waiting on Customer) Case #00666204 (RHN TRACEBACK generated) 
ref:00DA000HxWHMA0.500A00A5zZcIAJ:ref

--- 
| Case Information| 
--- 
https://access.redhat.com/support/cases/00666204
Case Title   : RHN TRACEBACK generated 
Case Number  : 00666204 
Case Open Date   : 2012-06-25 10:31:30

Most recent comment: On 2012-06-26 21:44:51, S V, Abhilash commented:
"Hello,


Thank you for your Support Request. My name is Abhilash S. V and I am taking 
over the ownership of your Support Request and will work with you to resolve 
this issue. 


You are hitting an already reported internal private bugzilla 
https://bugzilla.redhat.com/show_bug.cgi?id=822435. The 
bugzilla is not viewable to public. The bugzilla is on QA and we should have an 
errata soon.

Meanwhile, can you try to downgrade rhn-client-tools package to version 
1.0.0-73 in your client and check if it fixes the problems as of now.

Awaiting your update.

Thank you for choosing Red Hat and I look forward to working with you. 

Regards,
Abhilash"

--- 

Thank you for your latest interaction with Red Hat Global Support Services. We 
are currently working to resolve your case.

Your case has transitioned to "Waiting On Customer" status. This means that the 
Red Hat associate working on your case needs information or action from you to 
proceed. To help us resolve your case as quickly as possible, you will need to 
update your case online at https://access.redhat.com

Once you update the case, we can continue working to resolve your issue.

If you wish to contact Red Hat, visit https://access.redhat.com to find phone 
and web contact information relevant to your region and support contract. 


Thank you,

Red Hat Global Support Services
---

Have you joined the discussion in Groups yet? Visit 
https://access.redhat.com/groups to participate in our rapidly growing user 
community.

---   
ref:00DA000HxWHMA0.500A00A5zZcIAJ:ref


Re: [rt-users] in sql how do you get to custom fields?

2012-06-19 Thread Stuart Browne
Hi,

If it's a single value selected in the custom field, we generally use something 
like:

SELECT
...
PA.Content,
...
FROM
Tickets T
JOIN Users U ON T.Owner = U.id
JOIN Queues Q ON T.Queue = Q.id
LEFT OUTER JOIN (SELECT ObjectId, Content FROM ObjectCustomFieldValues 
WHERE CustomField = 27 AND ObjectType = 'RT::Ticket' AND Disabled = 0) PA ON 
PA.ObjectId = T.EffectiveId
WHERE
...

The CustomField value is shown in RT, or you can link in CustomFields in the 
outer join to get the field name involved.

Stuart

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Lander, Scott
Sent: Wednesday, 20 June 2012 7:31 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] in sql how do you get to custom fields?

I am using a 3rd party BI tool for some auditing tools here, and am trying to 
understand the table layout.

As part of the project I would like to list for a ticket the

Ticket number, creator, creator phone number, created date, the queue, the 
business unit, and other data.

I have figured out how to join the data from tickets, queues, and users tables, 
but I am not getting very far on the custom fields.   In my example above,  I 
have a custom field "Business Unit" and it has several different potential 
values.Can anyone suggest how I might add that to my query?

Currently I have:

select Tickets.id, Tickets.Status, Tickets.Subject,
Tickets.Created,tickets_creator_user.Name as "Creator",
Tickets.Started,tickets_owner_users.Name as "Owner",
Tickets.Resolved,  tickets_lastupdateby_users.Name as "Last Update By",
Queues.Name as "Queue"
from Tickets,
Users tickets_creator_user,
Users tickets_owner_users,
Users tickets_lastupdateby_users,
Queues
where Queues.id = Tickets.Queue and
Tickets.Creator = tickets_creator_user.id and
Tickets.Owner = tickets_owner_users.id and
Tickets.LastUpdatedBy = tickets_lastupdateby_users.id;

Thanks

Scott


This e-mail message is intended only for the personal use of the recipient(s) 
named above. If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, 
please notify the Hearst Service Center 
(cad...@hearstsc.com) immediately by email and 
delete the original message.



Re: [rt-users] TicketSQL Date parse weird..

2012-06-12 Thread Stuart Browne
> -Original Message-
> From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com]
> Sent: Wednesday, 13 June 2012 12:31 AM
> Subject: Re: [rt-users] TicketSQL Date parse weird..
> 
> Hello Stuart,
> 
> I've made a typo in the patch. It should be "ZONE" instead of "GMT".
> You can change code by hands after patching, it's close to line 208 in
> lib/RT/Date.pm.
> 
> Also, make sure ParseDate module is the latest from the CPAN.
> 



Ensured I'm running the latest ParseDate - 2011.0517.  Yes, I was running an 
older version.  The output didn't appear different before changing GMT to ZONE 
(for before-10am).

After changing GMT to ZONE, this happened:

#
# BEFORE 10AM
#

#
# Before patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339542313

fixed-date Time::ParseDate: 1339632000
tomorrow 10am Time::ParseDate:  1339632000

fixed-date RT::Date output: 1339668000
tomorrow 10am RT::Date output:  1339632000
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

#
# After patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339542211

fixed-date Time::ParseDate: 1339632000
tomorrow 10am Time::ParseDate:  1339632000

fixed-date RT::Date output: 1339668000
tomorrow 10am RT::Date output:  0
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

So it doesn't like ZONE there it seems:

-GMT   => $self->Timezone($args{'Timezone'}),
+ZONE  => $self->Timezone($args{'Timezone'}),

I'll try again after 14:00 (with GMT and the new ParseDate), although why 
RT::Date is returning 0 there is just odd.

Stuart


Re: [rt-users] TicketSQL Date parse weird..

2012-06-08 Thread Stuart Browne
> > 
> >
> > Using either 'user' or 'server' as the timezone I get the same result
> but I'm probably missing something here for the fixed-date (I can accept
> that the date might be being modified elsewhere I'm yet to find), but the
> 'tomrorow 10am' shouldn't be a full day off.  So the adding of the
> timezone offset before Time::ParsEdate::parsedate then removing it again
> appears to be causing the issue here; pushing today past the end of the
> day boundary.
> >
> 
> I can believe it's wrong. Time::ParseDate can do timezones, but
> timezones support is very limited, so we do our timezones after
> parsing in UTC. Understandably 'tomorrow 10am' in london while you're
> somewhere else is completely different thing.
> 
> We do some compensation in NOW argument and in theory it should work.
> Are you on the latest version of the module?
> 
> Never noticed before that ZONE argument can take whatever TZ
> environment variable can take. May be attached patch will just work.
> Have not tested it. Applies cleanly to 3.8 and 4.0.
> 
> > I'll try this routine tomorrow morning (before 10am) to see if it shows
> the right thing, then try to figure out a way to get it to return the same
> result for the two RT::Date outputs.

Ruslan,

I’m using RT 3.8.8 at the moment.  did some tests this morning (before the 
10-hour's from UTC) and all the times aligned.  With your patch, the worded 
time was off by TZ:

#
# BEFORE 10AM
#

#
# Before patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339111474

fixed-date Time::ParseDate: 133920
tomorrow 10am Time::ParseDate:  133920

fixed-date RT::Date output: 133920
tomorrow 10am RT::Date output:  133920
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

#
# After patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339111434

fixed-date Time::ParseDate: 133920
tomorrow 10am Time::ParseDate:  133920

fixed-date RT::Date output: 133920
tomorrow 10am RT::Date output:  1339236000
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

This was fine all the way until there was TZ seconds until the end of the day 
(after 14:00 for me).  Results from that period:

#
# After 14:00
#

#
# Before Patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339128542

fixed-date Time::ParseDate: 133920
tomorrow 10am Time::ParseDate:  133920

fixed-date RT::Date output: 133920
tomorrow 10am RT::Date output:  1339286400
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

#
# After Patch
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339128507

fixed-date Time::ParseDate: 133920
tomorrow 10am Time::ParseDate:  133920

fixed-date RT::Date output: 133920
tomorrow 10am RT::Date output:  1339236000
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

So the un-patched is definitely wrong.  The patched is more consistent but 
sadly still wrong.  Perhaps putting the removal of TZ back in to get the 
expected result more consistently:

#
# Additional line
#
[bekar@psg-apps tmp]$ ./test.pl
current time() output:  1339139429

fixed-date Time::ParseDate: 133920
tomorrow 10am Time::ParseDate:  133920

fixed-date RT::Date output: 133920
tomorrow 10am RT::Date output:  133920
timezone according to RT::Date: 36000
timezone according to RT::Date: 36000

Coming up to a public holiday here so I won't be in a position to do any 
testing until Tue/Wed next week.  I'll try it again before 10-am to see if I 
get a consistent result.

Stuart


alternate-date.patch
Description: alternate-date.patch


Re: [rt-users] TicketSQL Date parse weird..

2012-06-07 Thread Stuart Browne
> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Kevin Falcone
> Sent: Thursday, 7 June 2012 1:00 PM
> To: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] TicketSQL Date parse weird..
> 
> On Tue, Jun 05, 2012 at 06:06:09PM +1000, Stuart Browne wrote:
> > When doing a TicketSQL search similar to the following:

> 
> RT actually passes a number of arguments to parsedate:
> 
> grep can find where it's called (not in SQL.pm)
> 
> $ grep -r Time::ParseDate::parsedate lib/
> lib/RT/Articles.pm:my $seconds = Time::ParseDate::parsedate(
> $args{$date}, FUZZY => 1, PREFER_PAST => 1 );
> lib/RT/Date.pm:my $date = Time::ParseDate::parsedate(
> 
> -kevin

Ok, further test (see attached perl routine):

[root@psg-apps tmp]# ./test.pl.txt
current time() output:  1339054410

fixed-date Time::ParseDate: 1339113600
tomorrow 10am Time::ParseDate:  1339113600

fixed-date RT::Date output: 1339149600
tomorrow 10am RT::Date output:  133920
timezone according to RT::Date: 36000


Using either 'user' or 'server' as the timezone I get the same result but I'm 
probably missing something here for the fixed-date (I can accept that the date 
might be being modified elsewhere I'm yet to find), but the 'tomrorow 10am' 
shouldn't be a full day off.  So the adding of the timezone offset before 
Time::ParsEdate::parsedate then removing it again appears to be causing the 
issue here; pushing today past the end of the day boundary.

I'll try this routine tomorrow morning (before 10am) to see if it shows the 
right thing, then try to figure out a way to get it to return the same result 
for the two RT::Date outputs.

Stuart
#!/usr/bin/perl
use lib '/opt/rt3/lib';

package RT;
use strict;
use Time::ParseDate;
use RT::Interface::CLI qw(CleanEnv);

CleanEnv();
RT::LoadConfig();
RT::Init();

use RT::Date;
my $now = time;

printf("current time() output:  %s\n", $now);

print "\n";

printf("fixed-date Time::ParseDate: %s\n", 
Time::ParseDate::parsedate('2012-06-08 10:00:00'));
printf("tomorrow 10am Time::ParseDate:  %s\n", 
Time::ParseDate::parsedate('tomorrow 10am'));

print "\n";

my $date = new RT::Date($RT::SystemUser);
printf("fixed-date RT::Date output: %s\n", $date->Set(Format => 'sql', 
Value => '2012-06-08 10:00:00'));
printf("tomorrow 10am RT::Date output:  %s\n", $date->Set(Format => 'unknown', 
Value => 'tomorrow 10am'));
printf("timezone according to RT::Date: %s\n", ($date->Localtime( 'user', $now 
))[9]);


[rt-users] TicketSQL Date parse weird..

2012-06-05 Thread Stuart Browne
Hi,

Using RHEL5, RT 3.8.8, Time::DateParse 2006.0814.

When doing a TicketSQL search similar to the following:

Status = 'open' AND Due <= '10am tomorrow'

The time portion of the string isn't taken into account.

On the command line, a quick test of Time::DateParse shows it works:

]# perl -e 'use Time::ParseDate; print parsedate("2012-06-06 10:00") . "\n"; 
print parsedate("10am tomorrow") . "\n";'
1338940800
1338940800

So it appears as if RT is parsing the date string of 'Due' and messing with it. 
 Using the time portion before or after, using 10am vs 10:00, none appear to 
work.  Using any time component has the same result (thinking it may be a 
timezone issue. It wasn't).

I can't see in the RT code where this might be happening (been looking in 
SQL.pm).  Can someone point me in the right direction?

Thanks

Stuart J. Browne
Senior Unix Administrator, Network Administrator, Database Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain privileged and/or 
confidential information. If you are not an intended recipient you must not 
use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.




Re: [rt-users] Adding users

2011-11-06 Thread Stuart Browne
Sorry, was trying to dig up some example code for you, but the system I have it 
on crashed :-/ boo.

This thread has the basics of it though: 
http://www.mail-archive.com/rt-users@lists.bestpractical.com/msg26316.html


From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jim T
Sent: Monday, 7 November 2011 12:45 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Adding users

Hi Stuart,

Thanks for the reply, I'd just managed to figure it it out. Never used the API, 
but sounds like I should should. Can you offer any pointers?

Regards, Jim
On Mon, Nov 7, 2011 at 12:45 AM, Stuart Browne 
mailto:stuart.bro...@ausregistry.com.au>> 
wrote:
That would probably be in Principals, with the 'Disabled' field set to '0'.

That being said, you should probably use the API to create users en-masse.  It 
would avoid minor problems like this.

Stuart

From: 
rt-users-boun...@lists.bestpractical.com<mailto:rt-users-boun...@lists.bestpractical.com>
 
[mailto:rt-users-boun...@lists.bestpractical.com<mailto:rt-users-boun...@lists.bestpractical.com>]
 On Behalf Of Jim T
Sent: Monday, 7 November 2011 11:11 AM
To: rt-users@lists.bestpractical.com<mailto:rt-users@lists.bestpractical.com>
Subject: [rt-users] Adding users

Hello,

I have to add about 80 users to RT. These will be unprivileged users that will 
use the SelfService link to create tickets. I have succesfully imported the 
users directly into MySQL on a test system with phpMyAdmin. However I can't 
find where to "Allow this user to access RT" in any of the db fields. Does 
anybody know how I can achieve this?

Regards, Jim


RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain — November 28 & 29, 2011

Re: [rt-users] Adding users

2011-11-06 Thread Stuart Browne
That would probably be in Principals, with the 'Disabled' field set to '0'.

That being said, you should probably use the API to create users en-masse.  It 
would avoid minor problems like this.

Stuart

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Jim T
Sent: Monday, 7 November 2011 11:11 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Adding users

Hello,

I have to add about 80 users to RT. These will be unprivileged users that will 
use the SelfService link to create tickets. I have succesfully imported the 
users directly into MySQL on a test system with phpMyAdmin. However I can't 
find where to "Allow this user to access RT" in any of the db fields. Does 
anybody know how I can achieve this?

Regards, Jim

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain — November 28 & 29, 2011

Re: [rt-users] Link values to - use multiple CF values

2011-09-01 Thread Stuart Browne
> -Original Message-
> Sent: Friday, 2 September 2011 10:26 AM
> 
> On Fri, Sep 02, 2011 at 09:45:28AM +1000, Stuart Browne wrote:
> > The documentation is fairly vague on custom callbacks.  Thanks to
> http://www.runpcrun.com/node/272 for the clue as to where the custom
> callback should be located.
> 
> The Customizing documentation should link to a page on callbacks
> 
> http://requesttracker.wikia.com/wiki/Customizing
> 
> -kevin

I read through that, but it wasn't detailed enough for me to understand it on 
the first pass.  I've used callbacks before like that page (overriding some 
behaviours on the Modify/Update ticket pages), but this stuff doesn't really 
fit in to those nodes.  The concept of creating a custom callback isn't even 
mentioned let alone the path to put the callback content.

So just a bit lacking.  I should get off my arse and expand that page.  Maybe 
this weekend.

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] Link values to - use multiple CF values

2011-09-01 Thread Stuart Browne
Damn, missed the path properly:
 
--- 
/opt/rt3/local/html/Callbacks/MingleCardNumberLink/Elements/ShowCustomFields/ShowComponentName
<%INIT>
if ($CustomField->Name eq 'Mingle Card Number') {
$$Name = 'DisplayMingleCardLink';
}

<%ARGS>
$Name => undef
$CustomField => undef
$Object => undef


--- /opt/rt3/local/html/Elements/DisplayMingleCardLink
% my $output = $Object->Content;
%
% my $MingleCard= $Object->Content;
% if (defined $MingleCard && $MingleCard) {
%   my $MingleProject = $Object->Object->FirstCustomFieldValue('Mingle 
Project');
%   if ($MingleProject eq '') {
%   $MingleProject = 'dnr';
%   }
%   $output = sprintf("%s", $MingleProject, $MingleCard, 
$MingleCard);
% }
<%$output|n%>
<%ARGS>
$Object => undef

---

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] Link values to - use multiple CF values

2011-09-01 Thread Stuart Browne
> > On Thu, Sep 01, 2011 at 12:05:57PM +1000, Stuart Browne wrote:
> > > > I'd just do a custom display of that Custom Field and build the link
> > > > myself, rather than trying to extend the link to functionality.
> > > >
> > > > You'll probably find the ShowComponentName callback useful
> > >
> > > Thanks for the suggestion.
> > >
> > > This is what I ended up with.
> >
> > I actually meant that you should use that callback to change what
> > component is used for display.  You're passed $Name, assign to it by
> > reference (say ShowCustomFieldCustomLink) if you're in the right
> > custom field and then write your custom code into the
> > ShowCustomFieldCustomLink element in local/
> >
> > That callback isn't intended as a place to printf from
> 
> Ahh, righteo.  Will look at it again if I have some time ;)

Ok, now that you've said that, the code read makes more sense (not a 
programmer! So very much not a programmer!).

Ended up with:

--- 
/opt/rt3/local/html/Callbacks/MingleCardNumberLink/Elements/ShowCustomFields/ShowComponentName
<%INIT>
if ($CustomField->Name eq 'Mingle Card Number') {
$$Name = 'DisplayMingleCardLink';
}

<%ARGS>
$Name => undef
$CustomField => undef
$Object => undef


--- /opt/rt3/local/html/Elements
% my $output = $Object->Content;
%
% my $MingleCard= $Object->Content;
% if (defined $MingleCard && $MingleCard) {
%   my $MingleProject = $Object->Object->FirstCustomFieldValue('Mingle 
Project');
%   if ($MingleProject eq '') {
%   $MingleProject = 'dnr';
%   }
%   $output = sprintf("%s", $MingleProject, $MingleCard, 
$MingleCard);
% }
<%$output|n%>
<%ARGS>
$Object => undef

---

The documentation is fairly vague on custom callbacks.  Thanks to 
http://www.runpcrun.com/node/272 for the clue as to where the custom callback 
should be located.

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] Link values to - use multiple CF values

2011-09-01 Thread Stuart Browne


> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Kevin Falcone
> Sent: Thursday, 1 September 2011 11:13 PM
> To: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] Link values to - use multiple CF values
> 
> On Thu, Sep 01, 2011 at 12:05:57PM +1000, Stuart Browne wrote:
> > > I'd just do a custom display of that Custom Field and build the link
> > > myself, rather than trying to extend the link to functionality.
> > >
> > > You'll probably find the ShowComponentName callback useful
> >
> > Thanks for the suggestion.
> >
> > This is what I ended up with.
> 
> I actually meant that you should use that callback to change what
> component is used for display.  You're passed $Name, assign to it by
> reference (say ShowCustomFieldCustomLink) if you're in the right
> custom field and then write your custom code into the
> ShowCustomFieldCustomLink element in local/
> 
> That callback isn't intended as a place to printf from

Ahh, righteo.  Will look at it again if I have some time ;)

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] Link values to - use multiple CF values

2011-08-31 Thread Stuart Browne
> I'd just do a custom display of that Custom Field and build the link
> myself, rather than trying to extend the link to functionality.
> 
> You'll probably find the ShowComponentName callback useful

Kevin,

Thanks for the suggestion.

This is what I ended up with.

/opt/rt3/local/html/Callbacks/MingleCardNumberLink/Elements/ShowCustomFields/ShowComponentName:
---
<%INIT>
#
# Bail if the ticket doesn't have a value in the 'Mingle Card Number' CF.
#
if ($CustomField->Name eq 'Mingle Card Number') {
#
# Construct URL to Mingle
#
my $MingleCard= $Object->FirstCustomFieldValue('Mingle Card 
Number');
if (defined $MingleCard && $MingleCard) {
my $MingleProject = $Object->FirstCustomFieldValue('Mingle 
Project');
if ($MingleProject eq '') {
$MingleProject = 'dnr';
}
printf("(Click) - 
http://URL/projects/%s/cards/";, $MingleProject, $MingleCard, $MingleProject);
}
}

<%ARGS>
$Name => undef
$CustomField => undef
$Object => undef

---

It has one limitation sadly, I can't stop RT from printing the value of the 
custom field (thus the weird '(Click) - ...'), but this is enough for now ;)

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] REST interface, getting custom fields

2011-08-30 Thread Stuart Browne
> > Hi,
> >
> > I'm using the perl module 'RT::Client::REST' to query the database for
> > tickets with a specific custom field with a value and update the tickets
> > to a different owner and state.
> >
> > Script works for 2 other queues without issue.  The 3rd queue however,
> > configured the same as far as I can see, behaves differently.
> 
> Sadly, I've confirmed this is a bug in the RT::Client::REST interface
> (also in 0.41).  Using RT's '/opt/rt3/bin/rt' does correctly retrieve all
> the custom fields.
> 
> Time for debug.

Debug has found the following (in both /opt/rt3/bin/rt and 
RT::Client::REST::Forms and RT::Client::REST::Object):

* $CF_name defines the list of valid characters in a custom field name. 
 The field before my missing custom field had a question-mark in it (?).  This 
caused the field matching in the form parse routine to fail.
* The RT::Client::REST::Object did further parsing to break down the 
attributes into a __cf hash.  It re-parsed the custom field names.  Same deal, 
question-mark.

Sending a patch through to the CPAN.  Single-character addition ;)

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] REST interface, getting custom fields

2011-08-30 Thread Stuart Browne
> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Stuart Browne
> Sent: Tuesday, 30 August 2011 5:09 PM
> To: rt-users@lists.bestpractical.com
> Subject: [rt-users] REST interface, getting custom fields
> 
> Hi,
> 
> I'm using the perl module 'RT::Client::REST' to query the database for
> tickets with a specific custom field with a value and update the tickets
> to a different owner and state.
> 
> Script works for 2 other queues without issue.  The 3rd queue however,
> configured the same as far as I can see, behaves differently.

Sadly, I've confirmed this is a bug in the RT::Client::REST interface (also in 
0.41).  Using RT's '/opt/rt3/bin/rt' does correctly retrieve all the custom 
fields.

Time for debug.

Stuart

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


[rt-users] Link values to - use multiple CF values

2011-08-30 Thread Stuart Browne
Hi,

I was wondering if anybody knew of any extensions that could create a link from 
more than one custom fields combined together.

Situation:

I have a custom field with a mingle card number. Link-to value works fine for a 
single mingle project, project name is in the path.  Sadly, the card numbers 
are not unique between projects.

As such, I've created a second custom field with the project name in it.  For 
automated card creation, this works fine.  However, the link-to value is still 
hard-wired to the single project.

I thought maybe I could use a search-style CF{name} to get the value of another 
custom field, but looking at the documentation in 
ObjectCustomFieldValue_Overlay.pm seems to indicate that it isn't possible.

Does anybody know of an extension or other 'patch' to allow the inclusion of 
multiple CF values within the link-to  URL's?  Or do I need to create my own 
internal jump-to page to do the mapping externally? 

Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.



RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


[rt-users] REST interface, getting custom fields

2011-08-30 Thread Stuart Browne
Hi,

I'm using the perl module 'RT::Client::REST' to query the database for tickets 
with a specific custom field with a value and update the tickets to a different 
owner and state.

Script works for 2 other queues without issue.  The 3rd queue however, 
configured the same as far as I can see, behaves differently.

The script does a search and finds tickets that meet the criteria (CF.{Mingle 
Card Number} > 0), which says to me that the tickets have the custom field 
visible to the user I'm logged in as.  Cool.

I then loop through the search results getting the individual ticket details 
(to get the value of the custom field):

my $ticket = RT::Client::REST::Ticket->new(
rt => $_RT,
id => $id,
)->retrieve;
if (!defined($ticket->cf($_cf_name))) {
print Dumper($ticket->{'__cf'});
printf(STDERR "Unable to find the %s on ticket %d\n", 
$_cf_name, $id);
next;
}

This fails on the one queue.

Example of the failure:

$VAR1 = {
  '(sc/fr) clarifications' => 'N/A',
  '(sc/fr) summary' => 'For one thing it will make reports that are no 
longer downloadable accessible.',
  '(sc/fr) scope' => 'Reporting components of the *** website.',
  'user priority' => '',
  'psm monitor' => '',
  'dev priority' => '2 - Needs looking at within a week or so',
  '(sc/fr) context' => 'Line limit is no longer required.'
};
Unable to find the Mingle Card Number on ticket 7152

I've gone over the permissions on the queue a few times, left it for a few 
hours and reviewed them again.  I can't figure out why this works for the other 
queues and not this one.

No errors are logged at debug level.  A restart of the apache instance doesn't 
resolve the issue.

User ID: 11098, member of:
Group ID: 147279 (Principals id: 147279)
Queue ID: 31
CF ID: 49

Confirmed the CF is allocated to the queue with the name 'Mingle Card Number' 
('select * from ObjectCustomFields where CustomField = 49 and ObjectId = 31' 
and 'select Name from CustomFields where id = 49') and that there is only one 
Custom Field with this name.

Group has the following permissions on the queue (confirmed by ' select * from 
ACL where ObjectId = 31 and PrincipalId = 147279'):
ModifyCustomField
ModifyTicket
OwnTicket
SeeCustomField


Where should I be checking next?


RT 3.8.8, RT::Client::REST 0.40, RedHat, MySQL.

Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.



RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26 & 27, 2011
*  San Francisco, CA, USA  October 18 & 19, 2011
*  Washington DC, USA  October 31 & November 1, 2011
*  Melbourne VIC, Australia  November 28 & 29, 2011
*  Barcelona, Spain  November 28 & 29, 2011


Re: [rt-users] Disallow 'resolve' unless a CF is set?

2011-01-11 Thread Stuart Browne
I don't suppose you could throw that up onto the wiki so people don't have to 
hunt it down through the mailing list archives? :)

*copies locally to implement later*

> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Jeff Blaine
> Sent: Wednesday, 12 January 2011 4:39 AM
> To: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] Disallow 'resolve' unless a CF is set?
> 
> SUMMARY:
> 
> Here's how I did it, based on code from others.  Two callbacks
> that are very similar in code.  The end result is that if a
> user tries to resolve a ticket when a certain CF is not set,
> that user will get an error message within the RT page
> due to the Abort() call.  In an ideal world, the user would
> see the error message and be provided with the data to correct,
> but I couldn't figure out how to get that to work properly
> using the callback calls *provided by RT*.
> 
> ==
> 
> Part 1:  "Modify.html/Default" callback (user submitted a form from
>   The Basics)
> 
> <%INIT>
> # Modify.html/Default
> 
> my $ARGSRef = $ARGS{'ARGSRef'};
> # Bail if a resolve operation is not being tried.
> my $Status = $$ARGSRef{'Status'};
> if ($Status !~ /resolved/) {
> return 1;
> }
> 
> my $ticket = LoadTicket($$ARGSRef{'id'});
> my $CustomFields = $ticket->QueueObj->TicketCustomFields();
> while (my $CustomField = $CustomFields->Next()) {
>  my $nam = $CustomField->Name;
>  my $val = $ticket->FirstCustomFieldValue($nam);
> 
>  if (($nam =~ /SomeRequiredField/i) and ($val =~ /^\s*$/)) {
>  Abort("ERROR: SomeRequiredField must be set to allow resolving.
>   Please use your browser's 'Back' button to correct this issue as
> desired.");
> }
> }
> 
> return 1;
> 
> 
> <%ARGS>
> 
> 
> ==
> 
> Part 2: "Update.html/Initial" callback.  User clicked "Resolve"
>  hyperlink on a ticket (upper right).
> 
> <%INIT>
> my $ARGSRef = $ARGS{'ARGSRef'};
> 
> # Bail if a resolve operation is not being tried.
> my $DefaultStatus = $$ARGSRef{'DefaultStatus'};
> if ($DefaultStatus !~ /resolved/) {
> return 1;
> }
> 
> my $ticket = LoadTicket($$ARGSRef{'id'});
> my $CustomFields = $ticket->QueueObj->TicketCustomFields();
> while (my $CustomField = $CustomFields->Next()) {
>  my $nam = $CustomField->Name;
>  my $val = $ticket->FirstCustomFieldValue($nam);
> 
>  if (($nam =~ /SomeRequiredField/i) and ($val =~ /^\s*$/)) {
>  Abort("ERROR: SomeRequiredField must be set to allow resolving.
>   Please use your browser's 'Back' button to correct this issue as
> desired.");   }
> }
> 
> return 1;
> 
> 
> <%ARGS>
> 


Re: [rt-users] time worked - within a certain time period

2011-01-05 Thread Stuart Browne
Doesn't that miss if someone just changes the TimeWorked value on the Basic tab 
of the ticket?

I use (in MySQL SQL):

SUM(IF(Field = 'TimeWorked', NewValue - OldValue, TimeTaken)) as TimeWorked

> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Ruslan Zakirov
> Sent: Thursday, 6 January 2011 11:13 AM
> To: tarminuscf
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] time worked - within a certain time period
> 
> Hi,
> 
> SELECT SUM(TimeWorked) FROM Transactions WHERE ObjectId = 
> AND ObjectType = 'RT::Ticket' AND Created BETWEEN  AND
> ;
> 
> On Thu, Jan 6, 2011 at 1:45 AM, tarminuscf  wrote:
> >
> > Hi All,
> >
> > If I have a ticket that is 1 month old. How can I get the value of time
> > worked tallied up for only the last 7 days the ticket was worked on?
> >
> > So if the ticket has a grand total of 200 minutes on the 1 month old
> ticket.
> > But the last 7 days only have a cumulative 60 minutes worked. The value
> > I would be looking for is that 60 minutes.
> >
> > Anyone have insights on how I can get that value by means of RT
> reporting
> > or direct DB query?


Re: [rt-users] Possible to downgrade DB from 3.8 to 3.6?

2010-12-13 Thread Stuart Browne
> > CPAN makes me cranky, but trying to package all the perl modules as RPMs
> > makes me crankier. It's like wrapping one packaging system around
> another
> > one, and fighting with both of them.

I've done this quite successfully.  I've got RH distributed perl + packages 
plus those that I've manually packaged for RT to operate correctly living side 
by side.  

> > The reality is, every time RHEL updates perl, RT will break. I solve
> this
> > by having an identical test system. I apply the updates, see what
> breaks,
> > and then reinstall the perl modules in question using CPAN.

I've not had a RH update break my RT system in over a year, and that was 
because one of my packages was badly done.

You just have to figure out which packages are conflicting badly (CGI, Encode 
and File::Temp for instance) and make sure it's using vendor_perl instead of 
site_perl installation locations and sometimes relocate some man pages to avoid 
conflicts. 

> > I am used to this, but it is less than ideal.
> >
> > RHEL is a major platform, and I'd love it if BestPractical supported it
> > in some official way so we don't have these kinds of problems we have to
> > work around.
> >
> > Still, I love RT and praise it to anyone who will listen.

Agreed :)

Stuart


Re: [rt-users] Hardware requirements / guidelines?

2010-11-04 Thread Stuart Browne
> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Jeff Blaine
> Sent: Friday, 5 November 2010 1:16 AM
> To: rt-users@lists.bestpractical.com
> Subject: [rt-users] Hardware requirements / guidelines?
> 
> What are the minimum specifications / guidelines for hardware on which to
> run RT?
> 
> I was unable to find anything specific in the wiki.

It depends heavily upon how many users you intend to have and how many tickets 
you expect created.  If the numbers are small (less than a 40 or so privileged 
users, only a few hundred tickets a week), a small VM is just fine (as Seth 
mentioned).

RT its self is just a small web application.  The database it uses on the other 
hand can get large and unwieldy; the database requires considerably more 
resources than RT.

We have about 30 privileged users, don't use SelfService bug to through about 
1000-1000 tickets a week.  We use a Pentium D (older workstation model) server 
with 4GB of memory for both front end and database.  We use MySQL for RT's 
database, it is about 1.5GB and has about 40,000 tickets.  The machine isn't 
pushed hard.

Stuart


Re: [rt-users] 'Show Results' link / Query Builder occasionally not working properly

2010-10-19 Thread Stuart Browne
Applied, tested.  Beautiful.

Thank you Ruslan.

> -Original Message-
> From: ruslan.zaki...@gmail.com [mailto:ruslan.zaki...@gmail.com] On
> Behalf Of Ruslan Zakirov
> Sent: Tuesday, 19 October 2010 23:05
> To: Stuart Browne
> Cc: rt-users@lists.bestpractical.com
> Subject: Re: [rt-users] 'Show Results' link / Query Builder
> occasionally not working properly
> 
> Hi,
> 
> Issue has been fixed.
> 
> Patch:
> diff --git a/lib/RT/SQL.pm b/lib/RT/SQL.pm
> index 799cf94..946a8ab 100644
> --- a/lib/RT/SQL.pm
> +++ b/lib/RT/SQL.pm
> @@ -68,7 +68,7 @@ my @tokens = qw[VALUE AGGREGATOR OPERATOR OPEN_PAREN
> CLOSE_PAREN KEYWORD];
>  use Regexp::Common qw /delimited/;
>  my $re_aggreg  = qr[(?i:AND|OR)];
>  my $re_delim   = qr[$RE{delimited}{-delim=>qq{\'\"}}];
> -my $re_value   = qr[\d+|NULL|$re_delim];
> +my $re_value   = qr[[+-]?\d+|NULL|$re_delim];
>  my $re_keyword = qr[[{}\w\.]+|$re_delim];
>  my $re_op  = qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT
> LIKE)|(?i:LIKE)]; # long to short
>  my $re_open_paren  = qr[\(];
> 
> 
> SHA: 6c44641cd50c4f3ad631f4cb22292bb37a3c6c97
> 
> On Fri, Oct 15, 2010 at 3:51 AM, Stuart Browne
>  wrote:
> > Hi,
> >
> > Running RT 3.8.8 / DBIx::SearchBuilder 1.56, and have noticed some
> strange behaviour with the 'Show Results' link and the Query Builder.
> >
> > From the 'At A Glance' page, I generally click on 'xx highest
> priority tickets I own' to bring up the search result, then click 'Edit
> Search' and add 'Priority > -2' to show only positive value priority
> tickets.  Thus far, all is fine (and I understand I can just alter the
> saved search, but that's not what I want).
> >
> > From there, I use the list, going into and out of tickets, sometimes
> navigating into Configuration or other areas, then click back on
> 'Tickets' and 'Show Results'.  For whatever reason, the search is
> modified to be 'Priority > 2'.
> >
> > Steps to reproduce, and what is shown on the screen:
> >
> >        1. Log In
> >        2. Click on 'xx highest priority tickets I own'
> >        3. Click on 'Edit Search'
> >        4. Use dropdown boxes to add 'Priority' 'greater than' '-2',
> clicked 'Add these items' (or '... and Search')
> >                - At this point, the query is as follows:
> >                        Owner = '__CurrentUser__' AND (  Status =
> 'new' OR Status = 'open'
> >                                OR Status = 'validating' OR Status =
> 'WaitExt' ) AND
> >                                Queue != 'Holding' AND Priority > '-2'
> >        5. Click on any other left-hand menu item
> >        6. Click on 'Tickets'
> >                - Query shown is correct with the '-2' Priority
> >        7. Click on 'Show Results'
> >
> > At this point, the query has changed to:
> >
> >        Owner = '__CurrentUser__' AND (  Status = 'new' OR Status =
> 'open'
> >                OR Status = 'validating' OR Status = 'WaitExt' ) AND
> >                Queue != 'Holding' AND Priority > 2
> >
> > If at step 4, you press 'Add these items' 3 times, it also removes
> the negative.
> >
> > I'm not good enough at the internals of the query builder to know why
> the state of this field changes 'magically', but it didn't happen in
> prior versions.
> >
> > Has anybody else seen this, or can they reproduce the issue? ;)
> >
> > Stuart J. Browne


[rt-users] 'Show Results' link / Query Builder occasionally not working properly

2010-10-14 Thread Stuart Browne
Hi,

Running RT 3.8.8 / DBIx::SearchBuilder 1.56, and have noticed some strange 
behaviour with the 'Show Results' link and the Query Builder.

>From the 'At A Glance' page, I generally click on 'xx highest priority tickets 
>I own' to bring up the search result, then click 'Edit Search' and add 
>'Priority > -2' to show only positive value priority tickets.  Thus far, all 
>is fine (and I understand I can just alter the saved search, but that's not 
>what I want).

>From there, I use the list, going into and out of tickets, sometimes 
>navigating into Configuration or other areas, then click back on 'Tickets' and 
>'Show Results'.  For whatever reason, the search is modified to be 'Priority > 
>2'.

Steps to reproduce, and what is shown on the screen:

1. Log In
2. Click on 'xx highest priority tickets I own'
3. Click on 'Edit Search'
4. Use dropdown boxes to add 'Priority' 'greater than' '-2', clicked 
'Add these items' (or '... and Search')
- At this point, the query is as follows:
Owner = '__CurrentUser__' AND (  Status = 'new' OR 
Status = 'open'
OR Status = 'validating' OR Status = 'WaitExt' 
) AND
Queue != 'Holding' AND Priority > '-2'
5. Click on any other left-hand menu item
6. Click on 'Tickets'
- Query shown is correct with the '-2' Priority
7. Click on 'Show Results'

At this point, the query has changed to:

Owner = '__CurrentUser__' AND (  Status = 'new' OR Status = 'open'
OR Status = 'validating' OR Status = 'WaitExt' ) AND
Queue != 'Holding' AND Priority > 2

If at step 4, you press 'Add these items' 3 times, it also removes the negative.

I'm not good enough at the internals of the query builder to know why the state 
of this field changes 'magically', but it didn't happen in prior versions.

Has anybody else seen this, or can they reproduce the issue? ;)

Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.



RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year -- Learn how to get the most out of RT!


[rt-users] Getting CustomField 'Sort' order in Scrip

2010-10-10 Thread Stuart Browne
Hi,

Am trying to do a select-a-worded-priority for our interface and have set the 
sort order to the numeric priority values, but I can't figure out how to get 
the sort order from a Scrip on the queue so I can set the ticket's Priority 
($ticket->SetPriority(xxx)).

Is there a way using ObjectCustomFieldValues or just CustomFieldValues, instead 
of having to write a hash-map of word-to-number?

Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.



RT Training in Washington DC, USA on Oct 25 & 26 2010
Last one this year -- Learn how to get the most out of RT!


Re: [rt-users] what is the best way of changing FQDN while keeping the old?

2010-05-10 Thread Stuart Browne
> -Original Message-
> From: slamp slamp
> Sent: Tuesday, 11 May 2010 04:19
> 
> For example:
> 
> From rt.domA.com to rt.domB.com.
> 
> From supp...@doma.com to supp...@domb.com
> 
> During the transition, we would still like to support rt.domA.com via
> a redirecto rt.domB.com (apache). And e-mail to supp...@doma.com go to
> supp...@domb.com (sendmail).
> 
> Has anyone done this before?

This is what the 'virtusertable' in Sendmail is for.  You can map an entire 
domain to another entire domain:

>From /usr/share/sendmail-cf/README (RHEL box, sendmail-cf package):

The username from the original address is passed as %1 allowing:

@foo.org%...@example.com



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


Re: [rt-users] User prompted for authentication when opening new tabs

2010-04-05 Thread Stuart Browne
> -Original Message-
> From: Michael Ellis
> 
> Does anyone know of a browser setting that could explain why one user
> is prompted to authenticate for new tabs within the RT system? This
> does not happen every time, but enough to be annoying. RT is set to
> expire sessions after 8 hours.

It'd help to know what browser.  Off the top of my head though, I'd say a 
browser running in private / hidden mode could possibly do this.

Stuart

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


Re: [rt-users] [Perl script for RT ticket creation]

2010-03-04 Thread Stuart Browne
> From: badreddine meherzi
>
> I'm new on RT and I want to write a perl script that creates
> a ticket in RT, so how can I proceed, wich are the Perl modules
> that I have to install and is there an example of Perl script
> creating an RT ticket(that would helps me a lot).

This is parts scraped from what I use:

#!/usr/bin/perl -w
use strict;
use RT::Client::REST;
my $user = '';
my $pass = ''
my $url = '';
my $subject = '';
my $text_body = '';

my $_RT = RT::Client::REST->new(
server  => $url,
timeout => 30,
);
if (!$_RT->login(
username=> $user,
password=> $pass,
)) {
die ("Couldn't perform the login process\n");
}

my $number = $_RT->create(
type=> 'ticket',
set => {
queue   => 'Incident Response',
status  => 'new',
owner   => 'nobody',
requestor   => $user,
subject => $subject,
},
text=> $text_body,
);

if ($number > 0) {
print "Ticket $number created successfully\n";
}
exit(0);
1;


Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

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


[rt-users] Scip adding custom 'Results' line / Stopping transaction 'Set'

2010-03-03 Thread Stuart Browne
This is a re-send as no response in the week it was posted.
--
Hi,

I've got some custom fields for 3-point time estimates on project tickets.  
I've got it so that upon creation / update of the custom field, the 
'TimeEstimated' field gets set to the 'Most Likely' custom field value.  I've 
also got it so that it ignores any changes made manually to the 'TimeEstimated' 
field.

So far, so good.

I'd like to feed back to users that changes to the 'TimeEstimated' field 
shouldn't be made, that the 3-point fields should be modified together in order 
for changes to be made.

The most logical way to do this (to me) is to feed a 'Result' (what's expanded 
from @actions in 'share/html/Elements/ListActions') so it can be displayed in 
the box at the top of the page when a ticket update occurs.  I just can't find 
out how to do that.


I see that most of the messages come from 
Transaction_Overlay.pm/BriefDescriptions, but I can see that the messages from 
that function are generated automatically based on what the transaction 
actually is.

So, here's my question:

* Using a Scrip Condition / Prep, can a 'Set' be rejected to not occur 
and thus raise an 'error' ?
* If not, is there a way to feed back a custom message into the 
BriefDescriptions / @actions array so my own message can be displayed?


Current scrip:

Description: Re-Populate Estimate
Condition: User Defined
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate
Custom Condition:

my $_CF_NAME = '3 Point: Most Likely';
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $_CF = RT::CustomField->new ( $RT::SystemUser );
$_CF->LoadByNameAndQueue( Name => $_CF_NAME, Queue => 
$self->TicketObj->QueueObj->Name );

if (
$trans->Type eq 'Create' ||
($trans->Type eq 'CustomField' && $trans->Field == $_CF->id) ||
($trans->Type eq 'Set' && $trans->Field == 'TimeEstimated')
) {
  return 1;
}

Custom action preparation code:

return 1;

Custom action cleanup code:

my $_CF_NAME = '3 Point: Most Likely';

my $ticket = $self->TicketObj;
my $queue = $ticket->QueueObj->Name;
my $trans = $self->TransactionObj;

my $_CF = RT::CustomField->new ( $RT::SystemUser );
$_CF->LoadByNameAndQueue( Name => $_CF_NAME, Queue => $queue);
unless ($_CF->id) {
$RT::Logger->warning ("$_CF_NAME doesn't exist in Queue " . $queue);
return undef;
}

my $most_likely = $ticket->FirstCustomFieldValue($_CF->id);

if ($most_likely ne '' && $most_likely != $ticket->TimeEstimated) {
$RT::Logger->info(sprintf("Setting TimeEstimated from %s to value %s", 
$ticket->TimeEstimated, $most_likely));
$ticket->SetTimeEstimated($most_likely);
}

return 1;


Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.


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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

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


Re: [rt-users] Quick search

2010-02-28 Thread Stuart Browne
> -Original Message-
> From: stefan.rueetsc...@securiton.ch
> 
> I'd like to quick-search also on fixed/resolved tickets.
> 
> -Ursprüngliche Nachricht-
> Von: Renato S. Yamane
> 
> On start page I can see a Quick Search pannel, but it have only 3 kind
> of status (New, Open and Stalled).
> 
> Is possible add one more status (fixed/resolved)?

The quick search by default searches the @ActiveStatus values.

lib/RT/Search/Googlish.pm: 

163:push @tql_clauses, join( " OR ", map "Status = '$_'", 
RT::Queue->ActiveStatusArray());

This doesn't stop you from searching other states, it just means you have to 
list the state you want to search, i.e.:

resolved orange button

To search for a resolved ticket with the words 'orange' or 'button' in the 
subject.

A rough list of what the quick search can search on:

Fulltext Contet search: fulltext:string
Requester email address:requ...@email.address
Ticket Status:  resolved
Ticket ID:  12345
Queue name: 'General Support'
RT ticket owners:   stuart

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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

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


[rt-users] Scip adding custom 'Results' line / Stopping transaction 'Set'

2010-02-23 Thread Stuart Browne
Hi,

I've got some custom fields for 3-point time estimates on project tickets.  
I've got it so that upon creation / update of the custom field, the 
'TimeEstimated' field gets set to the 'Most Likely' custom field value.  I've 
also got it so that it ignores any changes made manually to the 'TimeEstimated' 
field.

So far, so good.

I'd like to feed back to users that changes to the 'TimeEstimated' field 
shouldn't be made, that the 3-point fields should be modified together in order 
for changes to be made.

The most logical way to do this (to me) is to feed a 'Result' (what's expanded 
from @actions in 'share/html/Elements/ListActions') so it can be displayed in 
the box at the top of the page when a ticket update occurs.  I just can't find 
out how to do that.

I see that most of the messages come from 
Transaction_Overlay.pm/BriefDescriptions, but I can see that the messages from 
that function are generated automatically based on what the transaction 
actually is.

So, here's my question:

* Using a Scrip Condition / Prep, can a 'Set' be rejected to not occur 
and thus raise an 'error' ?
* If not, is there a way to feed back a custom message into the 
BriefDescriptions / @actions array so my own message can be displayed?


Current scrip:

Description: Re-Populate Estimate
Condition: User Defined
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate
Custom Condition:

my $_CF_NAME = '3 Point: Most Likely';
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $_CF = RT::CustomField->new ( $RT::SystemUser );
$_CF->LoadByNameAndQueue( Name => $_CF_NAME, Queue => 
$self->TicketObj->QueueObj->Name );

if (
$trans->Type eq 'Create' ||
($trans->Type eq 'CustomField' && $trans->Field == $_CF->id) ||
($trans->Type eq 'Set' && $trans->Field == 'TimeEstimated')
) {
  return 1;
}

Custom action preparation code:

return 1;

Custom action cleanup code:

my $_CF_NAME = '3 Point: Most Likely';

my $ticket = $self->TicketObj;
my $queue = $ticket->QueueObj->Name;
my $trans = $self->TransactionObj;

my $_CF = RT::CustomField->new ( $RT::SystemUser );
$_CF->LoadByNameAndQueue( Name => $_CF_NAME, Queue => $queue);
unless ($_CF->id) {
$RT::Logger->warning ("$_CF_NAME doesn't exist in Queue " . $queue);
return undef;
}

my $most_likely = $ticket->FirstCustomFieldValue($_CF->id);

if ($most_likely ne '' && $most_likely != $ticket->TimeEstimated) {
$RT::Logger->info(sprintf("Setting TimeEstimated from %s to value %s", 
$ticket->TimeEstimated, $most_likely));
$ticket->SetTimeEstimated($most_likely);
}

return 1;


Stuart J. Browne
Senior Unix Administrator, Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.


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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22 & 23
Dublin, Ireland - Mar 15 & 16
Boston, MA, USA - April 5 & 6
Washington DC, USA - Oct 25 & 26

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


Re: [rt-users] Custom field textarea too small

2010-01-11 Thread Stuart Browne
> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Matt Adams
> Sent: Tuesday, 12 January 2010 16:44
> To: rt-users@lists.bestpractical.com
> Subject: [rt-users] Custom field textarea too small
> 
> Folks:
> 
> I've created a custom field for a static description we'll use on some
> of our project-related tickets.  Unfortunately the textarea is so small
> as to be almost useless.
> 
> Is there anything that can be easily done make this field more
> accessible?



Use Chrome, it can resize text areas..



Sadly, I've never been successful in 'easily' changing the textarea sizes.

I tend to use an external text editor then paste the results into the tiny-box.

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

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


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


Re: [rt-users] Is SQLite no longer supported?

2009-11-24 Thread Stuart Browne


> -Original Message-
> From: rt-users-boun...@lists.bestpractical.com [mailto:rt-users-
> boun...@lists.bestpractical.com] On Behalf Of Tom Lahti
> Sent: Wednesday, 25 November 2009 10:55
> To: Ivan Voras
> Cc: rt-users
> Subject: Re: [rt-users] Is SQLite no longer supported?
> 
> > Slightly offtopic - is there some "best practice" limit saying when
> > SQLite stops being efficient and it's time to use something bigger?
> Or
> > in other words, how large are average SQLite installations in terms
> of
> > users, tickets, etc.?
> 
> In my opinion, I would say that SQLite is appropriate for testing and
> development work, where you have developers working on customizations
> of
> RT.  I don't think SQLite is appropriate for production environments of
> any size.  But that's just me.

I'd have to completely with this.

SQLite's complete lack of threading model means responding to a single request 
at a time.

Simply put, if you have enough users that the possibility of multiple people 
requesting information at the same time, or a user request happening when an 
external ticket comes in (email via rt-mailgate etc.), then you're going to be 
causing users to stall, waiting.

You may be able to get away with it for a small number of concurrent users (1-5 
maybe) in a low volume environment, but if you're wanting to do anything 
serious with email coming in at any moment, then you'd be better off setting up 
a MySQL/PgSQL DB.  The effort isn't much different.

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

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


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


Re: [rt-users] RT Upgrade failing from 3.6.6 to 3.8.6 UPDATE: mason_data directory

2009-11-17 Thread Stuart Browne
> -Original Message-
> From: Barron, Josh
> 
> That file does not exist in the new RT directory, nor is any file by
> that name in use anywhere from what I can see.
> 
> I'm really baffled by this.

SELinux isn't turned on by any chance is it?

getenforce
ausearch -m avc -ts today

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

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


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


[rt-users] 'bin/rt' CLI, creating ticket with Owner

2009-11-15 Thread Stuart Browne
Hi,

I'm trying to get the CLI 'rt' tool to create a ticket with a specified owner.

I'm trying:

/opt/rt3/bin/rt create -t ticket set status=new 
owner="stuart.bro...@ausregistry.com.au"  subject="`date +'General Tasks %Y%m - 
%W'`" queue="au Maintenance" text="Auto-created weekly general tasks ticket." 
priority=1

Sadly, this is setting everything else other than the owner perfectly correctly.

I've tried setting the RTUSER with SuperUser as a last-effort, to no avail.

Is there any way (short of writing the create routine myself using the API) to 
set the owner at ticket creation time?

RHEL5.4
RT3.8.1

Stuart J. Browne
Unix/Network Administrator
AusRegistry Pty Ltd
Level 8, 10 Queens Road
Melbourne. Victoria. Australia. 3004.
Ph:  +61 3 9866 3710
Fax: +61 3 9866 1970
Email: stuart.bro...@ausregistry.com.au
Web: www.ausregistry.com.au

The information contained in this communication is intended for the named 
recipients only. It is subject to copyright and may contain legally privileged 
and confidential information and if you are not an intended recipient you must 
not use, copy, distribute or take any action in reliance on it. If you have 
received this communication in error, please delete all copies from your system 
and notify us immediately.

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

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


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


Re: [rt-users] What software is recommended for high-loaded RT3.8-latest?

2009-04-02 Thread Stuart Browne
Publicly faced:
Web server : 22:05:01 up 566 days, 10:38,  0 users,  load average: 0.04, 0.03, 
0.02
Mail server: 09:04:10 up 573 days, 15:16,  0 users,  load average: 0.16, 0.04, 
0.01
Name server: 22:04:16 up 573 days, 21:34,  0 users,  load average: 0.02, 0.05, 
0.00

RHEL5.

Simplicity isn't always better.  Management of distribution counts for a lot.

In any case, choose which ever platform you're comfortable with.

Stuart

-Original Message-
From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Tom Lahti
Sent: Friday, 3 April 2009 07:17
To: Agnislav Onufrijchuk
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] What software is recommended for high-loaded 
RT3.8-latest?

> I have no enough experience with Slackware. AFAIK, it's simple as BSD. Is it 
> true?

I second the Slackware vote.  I use it for everything.  It's the ultimate
distro for reliability-through-simplicity.  Install nothing you don't need.
 If you don't need xxgdb on your production server, don't install it.  (I
don't even have X installed on my servers, but that's just me).
Incidentally I frequently have servers go 200 days + without so much as a
reboot, even high volume FTP servers like this one:

r...@:~# uptime
 13:13:47 up 246 days,  1:53,  2 users,  load average: 0.23, 0.14, 0.05

> AFAIK, they're all provide good data safety. Now we're using MySQL && InnoDB, 
> I 
> think XFS should be fast enough. But we may migrate to PostgreSQL. AFAIK it 
> uses 
> a number of files (I may be wrong) to serve its DB. So, there can be 
> Reiser/JFS.

Filesystems are something I've spent a LOT of time on, so I know something
about this.

XFS has not-so-good safety.  The fsck / repair tools don't work on very
large filesystems because they need massive amount of memory -- more often
than not, more than you have.  If you need to fsck XFS, odds are you'll be
formatting it instead.  That said, it is deliciously fast and scalable when
properly optioned.  Use a RAID controller with battery backup and you should
be fine; otherwise turn off write-back caching.  Or, test your backups
frequently for restorability. :)

reiserfs is similiar to XFS with safety.  A fsck almost never works because
everything's a tree -- once the tree is scrambled, everything in the tree
below that point is scrambled too.  This is even a bigger risk if you don't
make the filesystem with notail.  You'll be formatting, not fsck'ing.  It
also doesn't scale well and its performance with large files is horrid.

JFS on the other hand, has wonderful repair tools and decent scalability.
Unfortunately, the performance of JFS degrades exponentially with the number
of inodes used (files & directories) as it searches everything rather
linearly, and the inode structure is necessarily inefficient to make it
easily repairable.  Not recommended for a filesystem with gobs and gobs of
small files.  (Unfortunately, I have two 12TB RAID arrays formatted JFS with
over 14 million small files on them, and if they weren't in production, I'd
change it in a heart-beat).

ext4 is no longer in development mode and is considered production quality
(in kernel 2.6.28 and newer).  I highly recommend using it over the other
options.  It is extent-based rather than block-mapped (if you format it as
such), it has the reliability of ext3 and then some (as the journal is
checksummed), and its even faster with lots of small files than reiser if
you create the filesystem with the dir_index option (which creates a hash of
directory entries that is even faster than reiser's b-tree).  It even fsck's
faster than ext3 because it skips unallocated space.

In short: XFS is fast and not reliable.  JFS is very reliable, but slow.
Reiserfs is a pitiful joke (which can used successfully by the daring &
lucky).  ext4 gives you everything you always asked for: the speed of XFS
(ok, almost), the fast lookups of reiser, and the reliability of JFS :)

-- 
-- 
   Tom Lahti
   BIT Statement LLC

   (425)251-0833 x 117
   http://www.bitstatement.net/
-- 
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


[rt-users] FW: 3.8.1 - New upgrade slow on 'New Search click

2009-02-05 Thread Stuart Browne
I sent this through a while ago, but got no responses.

Anybody know what can help with this slow 'Search page' coming up issue?

I've since seen a few other people mention the issue, but no response there 
either..

Anybody?

Stuart

-Original Message-----
From: Stuart Browne
Sent: Thursday, 4 December 2008 12:06
To: 'rt-users@lists.bestpractical.com'
Subject: 3.8.1 - New upgrade slow on 'New Search click

Hi,

After doing a 3.8.1 upgrade (install into new directory, upgrade db from 
3.6.5), clicking on 'Tickets' / 'New Search' causes a 10-15 second pause.

Digging through the active queries when that occurs shows the following query:

SELECT DISTINCT main.* FROM Users main CROSS JOIN ACL ACL_4 JOIN Principals 
Principals_1  ON ( Principals_1.id = main.id ) JOIN CachedGroupMembers 
CachedGroupMembers_2  ON ( CachedGroupMembers_2.MemberId = Principals_1.id ) 
JOIN Groups Groups_3  ON ( Groups_3.id = CachedGroupMembers_2.GroupId )  WHERE 
(Principals_1.Disabled = '0') AND (ACL_4.PrincipalType = Groups_3.Type) AND 
(Principals_1.id != '1') AND (Principals_1.PrincipalType = 'User') AND 
(ACL_4.RightName = 'OwnTicket' OR ACL_4.RightName = 'SuperUser') AND 
(Groups_3.Domain = 'RT::Queue-Role') AND ((ACL_4.ObjectType = 'RT::Queue') OR 
(ACL_4.ObjectType = 'RT::System'))  ORDER BY main.Name ASC

Eww.

Anyway.  The explain on this shows:

*** 1. row ***
   id: 1
  select_type: SIMPLE
table: main
 type: range
possible_keys: PRIMARY
  key: PRIMARY
  key_len: 4
  ref: NULL
 rows: 65
Extra: Using where; Using temporary; Using filesort
*** 2. row ***
   id: 1
  select_type: SIMPLE
table: Principals_1
 type: eq_ref
possible_keys: PRIMARY
  key: PRIMARY
  key_len: 4
  ref: rt3.main.id
 rows: 1
Extra: Using where; Distinct
*** 3. row ***
   id: 1
  select_type: SIMPLE
table: CachedGroupMembers_2
 type: ref
possible_keys: DisGrouMem,CachedGroupMembers3
  key: CachedGroupMembers3
  key_len: 5
  ref: rt3.Principals_1.id
 rows: 1
Extra: Using where; Distinct
*** 4. row ***
   id: 1
  select_type: SIMPLE
table: ACL_4
 type: range
possible_keys: ACL1
  key: ACL1
  key_len: 54
  ref: NULL
 rows: 82
Extra: Using where; Using index; Distinct
*** 5. row ***
   id: 1
  select_type: SIMPLE
table: Groups_3
 type: eq_ref
possible_keys: PRIMARY,Groups1,Groups2
  key: PRIMARY
  key_len: 4
  ref: rt3.CachedGroupMembers_2.GroupId
 rows: 1
Extra: Using where; Distinct

Using google, two possible matches were found.

- One of the queues has a 'Group Right' allowing 'Everyone' to 'Own Ticket'.  I 
have gone through all our queues, found one queue with this permission.  
Removed the permission, issue still persists.  I've even gone through and 
verified disabled queue's group rights.

- The explain shows 'Using filesort' and the 'tmp_table_size' should be 
increased.  Changing this to 4 times the default has had no effect.  This 
coupled with the fact that our DB isn't that big.

So, I was wondering if anybody else was experiencing this pause, and preferably 
if anybody knows what's causing it so I can fix it.

Thanks

Stuart J. Browne
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


Re: [rt-users] RT installation - theoretical installer

2008-12-22 Thread Stuart Browne
It would be possible to have your own perl installed into its own structure, 
with all its own localized modules, with its own library path pointing to where 
it was installed.

What would be difficult with a canned install however would be the web server 
configuration required / mod_perl stuff.

From: rt-users-boun...@lists.bestpractical.com 
[mailto:rt-users-boun...@lists.bestpractical.com] On Behalf Of Joseph Spenner
Sent: Tuesday, 23 December 2008 05:58
To: rt-users@lists.bestpractical.com
Subject: [rt-users] RT installation - theoretical installer

Would it be possible to have a totally canned RT, perhaps with its own perl 
with all the modules needed, and installed via some sort of web based 
installer?  Consider the following scenario:   I have a web/domain provider who 
handles my storage needs, such as godaddy.com.  I have tons of web space, but 
no control over the perl modules.  However, if everything were installed in my 
web space such that the canned RT cgi knew where to find its own perl, 
everything should work.  I can create aliases to point to queues as well, via 
my web providers' control panel tools.

A similar type of installer exists for a wonderful piece of free forums 
software called SMF ( http://www.simplemachines.org/ ).  It has a couple 
initial manual steps:  create a database on some mysql/postgress system, create 
a database user with admin rights on that database.   That info is then entered 
that into a field of the web installer along with the location of the database, 
and hit GO.  It builds everything, lets you configure everything via a web 
interface, etc.

Perhaps I'm over simplifying the installation, so please feel free to point out 
the flaws.  The idea just popped into my head as I was taking a walk, spacing 
off.



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

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


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

[rt-users] 3.8.1 - New upgrade slow on 'New Search click

2008-12-03 Thread Stuart Browne
Hi,

After doing a 3.8.1 upgrade (install into new directory, upgrade db from 
3.6.5), clicking on 'Tickets' / 'New Search' causes a 10-15 second pause.

Digging through the active queries when that occurs shows the following query:

SELECT DISTINCT main.* FROM Users main CROSS JOIN ACL ACL_4 JOIN Principals 
Principals_1  ON ( Principals_1.id = main.id ) JOIN CachedGroupMembers 
CachedGroupMembers_2  ON ( CachedGroupMembers_2.MemberId = Principals_1.id ) 
JOIN Groups Groups_3  ON ( Groups_3.id = CachedGroupMembers_2.GroupId )  WHERE 
(Principals_1.Disabled = '0') AND (ACL_4.PrincipalType = Groups_3.Type) AND 
(Principals_1.id != '1') AND (Principals_1.PrincipalType = 'User') AND 
(ACL_4.RightName = 'OwnTicket' OR ACL_4.RightName = 'SuperUser') AND 
(Groups_3.Domain = 'RT::Queue-Role') AND ((ACL_4.ObjectType = 'RT::Queue') OR 
(ACL_4.ObjectType = 'RT::System'))  ORDER BY main.Name ASC

Eww.

Anyway.  The explain on this shows:

*** 1. row ***
   id: 1
  select_type: SIMPLE
table: main
 type: range
possible_keys: PRIMARY
  key: PRIMARY
  key_len: 4
  ref: NULL
 rows: 65
Extra: Using where; Using temporary; Using filesort
*** 2. row ***
   id: 1
  select_type: SIMPLE
table: Principals_1
 type: eq_ref
possible_keys: PRIMARY
  key: PRIMARY
  key_len: 4
  ref: rt3.main.id
 rows: 1
Extra: Using where; Distinct
*** 3. row ***
   id: 1
  select_type: SIMPLE
table: CachedGroupMembers_2
 type: ref
possible_keys: DisGrouMem,CachedGroupMembers3
  key: CachedGroupMembers3
  key_len: 5
  ref: rt3.Principals_1.id
 rows: 1
Extra: Using where; Distinct
*** 4. row ***
   id: 1
  select_type: SIMPLE
table: ACL_4
 type: range
possible_keys: ACL1
  key: ACL1
  key_len: 54
  ref: NULL
 rows: 82
Extra: Using where; Using index; Distinct
*** 5. row ***
   id: 1
  select_type: SIMPLE
table: Groups_3
 type: eq_ref
possible_keys: PRIMARY,Groups1,Groups2
  key: PRIMARY
  key_len: 4
  ref: rt3.CachedGroupMembers_2.GroupId
 rows: 1
Extra: Using where; Distinct

Using google, two possible matches were found.

- One of the queues has a 'Group Right' allowing 'Everyone' to 'Own Ticket'.  I 
have gone through all our queues, found one queue with this permission.  
Removed the permission, issue still persists.  I've even gone through and 
verified disabled queue's group rights.

- The explain shows 'Using filesort' and the 'tmp_table_size' should be 
increased.  Changing this to 4 times the default has had no effect.  This 
coupled with the fact that our DB isn't that big.

So, I was wondering if anybody else was experiencing this pause, and preferably 
if anybody knows what's causing it so I can fix it.

Thanks

Stuart J. Browne
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


[rt-users] Getting current user's details in a Scrip

2008-12-01 Thread Stuart Browne
Hi,

I'm trying to tie a specific custom field down to being modified only by a 
specific user, but can't figure out how to find out what user is actually 
logged in doing the action.

Whenever I use $self->CurrentUser, it shows 'RT_System' instead of the user I'm 
logged in as, and the person isn't going to be the owner of the ticket.

Anybody have any ideas?

Stuart J. Browne
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


[rt-users] wiki homepage

2008-12-01 Thread Stuart Browne
Anybody know why it has a gaming log by 'harry1999' as its front page?

Stuart J. Browne

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

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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