[rt-users] Report for original queue count
Vegard Vesterheim
vegard.vesterheim at uninett.no
Fri Jan 23 02:35:48 EST 2015
On Thu, 22 Jan 2015 16:34:50 -0500 Kevin Falcone <falcone at bestpractical.com> wrote:
> On Thu, Jan 22, 2015 at 11:25:28AM +0100, Vegard Vesterheim wrote:
>> my $ticket = RT::Ticket->new($user);
>> while (my $t = $objs->Next) {
>> $ticket->Load ($t->ObjectId);
>> }
>
> You may appreciate my $ticket = $t->Object as a shortcut
Ah, much preferred, thanks for the tip.
>> This is a sledgehammer approach, I know. If you have a many
>> tickets/transactions, the query could take a long time.
>
> You may benefit from additional indexes, if this is something you do
> frequently (or the database slow query logs tell you when you hit
> that).
Yup. In my case this isn't a problem, but it might be for others.
>> In my case I want to restrict the search to a given timeperiod, aka: "How
>> many tickets where moved out of queue <foo> yesterday")
>
> It wasn't clear from your code if you know how to do that in the
> query, or if you're just stopping the iteration when you get far
> enough back.
In my own version of the script, I have additional code for limiting
against 'Created'. The original poster did not seem to have similar
requirements, so I left that out from the example.
- Vegard V -
More information about the rt-users
mailing list