Query Problem

Hi,

I posted this problem before but I wasn’t able to solve it.

I have detected some problems with the queries in RT (the variable
"Query" in RT, used to make searh on tickets)

The first problem is that you can’t make searches on Owner Real Name
(the only thing you can do is search with the exact owner name)

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier

Hi,

I posted this problem before but I wasn’t able to solve it.

I have detected some problems with the queries in RT (the variable
“Query” in RT, used to make searh on tickets)

The first problem is that you can’t make searches on Owner Real Name
(the only thing you can do is search with the exact owner name)
I plan to fix this in near future.

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Best regards, Ruslan.

I had a look at the SQL queries about the date problem.

In fact, when I search with a query like : Created = ‘2005-07-19’,
I find this in the SQL log :
( ( (main.Created >= ‘2005-07-18 00:00’)AND(main.Created <=
‘2005-07-18 23:59’) ) )

Has anyone an idea ?

Olivier2005/7/28, Ruslan Zakirov ruslan.zakirov@gmail.com:

On 7/28/05, Olivier Horec olivier.horec@gmail.com wrote:

Hi,

I posted this problem before but I wasn’t able to solve it.

I have detected some problems with the queries in RT (the variable
“Query” in RT, used to make searh on tickets)

The first problem is that you can’t make searches on Owner Real Name
(the only thing you can do is search with the exact owner name)
I plan to fix this in near future.

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com


Best regards, Ruslan.

Ok, here what we get:

  • I enter ‘2005-07-30’ in search box
  • Time::ParseDate converts it to ‘2005-07-29 20:00’ because of GMT+4 timezone
  • Then constuct search with interval [‘2005-07-29 00:00’; ‘2005-07-29 23:59’]

I think if we play only with dates then we should ignore timezone, so
I propose attached patch.

Olivier, could you confirm that patch fixes your problem?

I had a look at the SQL queries about the date problem.

In fact, when I search with a query like : Created = ‘2005-07-19’,
I find this in the SQL log :
( ( (main.Created >= ‘2005-07-18 00:00’)AND(main.Created <=
‘2005-07-18 23:59’) ) )

Has anyone an idea ?

Olivier

Hi,

[snip]

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com


Best regards, Ruslan.

Best regards, Ruslan.

search_on_date.patch (479 Bytes)

Hi Ruslan,

Thanks for your help

I applied this patch and it solves my problem : it was just a problem
with the GMT+4 timezone.

I applied the pacth “Searches by Owner’s fields” about the first
problem and it was successful too !

Thanks again,

Olivier2005/7/30, Ruslan Zakirov ruslan.zakirov@gmail.com:

Ok, here what we get:

  • I enter ‘2005-07-30’ in search box
  • Time::ParseDate converts it to ‘2005-07-29 20:00’ because of GMT+4 timezone
  • Then constuct search with interval [‘2005-07-29 00:00’; ‘2005-07-29 23:59’]

I think if we play only with dates then we should ignore timezone, so
I propose attached patch.

Olivier, could you confirm that patch fixes your problem?

On 7/28/05, Olivier Horec olivier.horec@gmail.com wrote:

I had a look at the SQL queries about the date problem.

In fact, when I search with a query like : Created = ‘2005-07-19’,
I find this in the SQL log :
( ( (main.Created >= ‘2005-07-18 00:00’)AND(main.Created <=
‘2005-07-18 23:59’) ) )

Has anyone an idea ?

Olivier

2005/7/28, Ruslan Zakirov ruslan.zakirov@gmail.com:

On 7/28/05, Olivier Horec olivier.horec@gmail.com wrote:

Hi,

[snip]

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com


Best regards, Ruslan.


Best regards, Ruslan.

Hi,

I have made a few tests with the patch “Searches by Owner’s fields”. I
have detected two problems.

First, I can’t search Ticketsw with the owner Id anymore (it was used
to display your tickets on the “RT at a glance” page)

When I make a search with “Owner = ‘Nobody’”, I get the Tickets
contained in the “___Approvals” queue. (when I don’t use “Owner =
‘Nobody’”, I don’t get these tickets)

Has anyone tried to install this patch ?

Thanks in advance

Olivier2005/8/1, Olivier Horec olivier.horec@gmail.com:

Hi Ruslan,

Thanks for your help

I applied this patch and it solves my problem : it was just a problem
with the GMT+4 timezone.

I applied the pacth “Searches by Owner’s fields” about the first
problem and it was successful too !

Thanks again,

Olivier

2005/7/30, Ruslan Zakirov ruslan.zakirov@gmail.com:

Ok, here what we get:

  • I enter ‘2005-07-30’ in search box
  • Time::ParseDate converts it to ‘2005-07-29 20:00’ because of GMT+4 timezone
  • Then constuct search with interval [‘2005-07-29 00:00’; ‘2005-07-29 23:59’]

I think if we play only with dates then we should ignore timezone, so
I propose attached patch.

Olivier, could you confirm that patch fixes your problem?

On 7/28/05, Olivier Horec olivier.horec@gmail.com wrote:

I had a look at the SQL queries about the date problem.

In fact, when I search with a query like : Created = ‘2005-07-19’,
I find this in the SQL log :
( ( (main.Created >= ‘2005-07-18 00:00’)AND(main.Created <=
‘2005-07-18 23:59’) ) )

Has anyone an idea ?

Olivier

2005/7/28, Ruslan Zakirov ruslan.zakirov@gmail.com:

On 7/28/05, Olivier Horec olivier.horec@gmail.com wrote:

Hi,

[snip]

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com


Best regards, Ruslan.


Best regards, Ruslan.

Hi,

I have made a few tests with the patch “Searches by Owner’s fields”. I
have detected two problems.

First, I can’t search Ticketsw with the owner Id anymore (it was used
to display your tickets on the “RT at a glance” page)
Is it your code? If so, please, show code sample.

When I make a search with “Owner = ‘Nobody’”, I get the Tickets
contained in the “___Approvals” queue. (when I don’t use “Owner =
‘Nobody’”, I don’t get these tickets)
What’s results you get without patch?

Has anyone tried to install this patch ?
Yeah, I made some hand testing, but could miss something…

Thanks in advance

Olivier

Hi Ruslan,

Thanks for your help

I applied this patch and it solves my problem : it was just a problem
with the GMT+4 timezone.

I applied the pacth “Searches by Owner’s fields” about the first
problem and it was successful too !

Thanks again,

Olivier

Ok, here what we get:

  • I enter ‘2005-07-30’ in search box
  • Time::ParseDate converts it to ‘2005-07-29 20:00’ because of GMT+4 timezone
  • Then constuct search with interval [‘2005-07-29 00:00’; ‘2005-07-29 23:59’]

I think if we play only with dates then we should ignore timezone, so
I propose attached patch.

Olivier, could you confirm that patch fixes your problem?

I had a look at the SQL queries about the date problem.

In fact, when I search with a query like : Created = ‘2005-07-19’,
I find this in the SQL log :
( ( (main.Created >= ‘2005-07-18 00:00’)AND(main.Created <=
‘2005-07-18 23:59’) ) )

Has anyone an idea ?

Olivier

Hi,

[snip]

The second problem is when you search tickets with dates : you get the
tickets one day before the query.

Has anyone tried to solve the problem or can anyone give me some ideas
to help me to solve it.

Thanks in advance

Olivier


The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com


Best regards, Ruslan.


Best regards, Ruslan.

Best regards, Ruslan.

Thanks for your reply,

Hi,

I have made a few tests with the patch “Searches by Owner’s fields”. I
have detected two problems.

First, I can’t search Ticketsw with the owner Id anymore (it was used
to display your tickets on the “RT at a glance” page)
Is it your code? If so, please, show code sample.

No, it’s in the code used to display tickets on the home page by default.
In html/Elements/MyTickets :
my $Query = " Owner = ‘“.$session{‘CurrentUser’}->Id.”’ AND ( Status =
‘new’ OR Status = ‘open’)";
(If I replace $session{‘CurrentUser’}->Id by
$session{‘CurrentUser’}->Name, it works)

When I make a search with “Owner = ‘Nobody’”, I get the Tickets
contained in the “___Approvals” queue. (when I don’t use “Owner =
‘Nobody’”, I don’t get these tickets)
What’s results you get without patch?

Without the patch, it never shows the Tickets in the “___Approvals” queue.