Hello!
Here is one thing I have noticed. GenericAgent module is not reacting to the ticket status change during its work. e.g. it is doing his actions without caring all the changes of status, notes etc. Has anyone looked at this issue as a problem, or is this planned functionality?
Cheers,
A.
Change time in GenericAgent
Moderator: crythias
-
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Change time in GenericAgent
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
-
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Re: Change time in GenericAgent
Some progress:
TicketSearch itself isn' t working correctly with Change Time!!!!!!!
After inspecting SQL statement sent to the databaselook what I have found:
As you can search will find ALL tickets which have been changed BEFORE the period of time no matter if it has changed after that time!!!
It is happening because of DISTINCT and ticket_history parsing
Change in SQL statement creation should be made in /Kernel/System/TicketSearch.pm
~ at line 1294
should be replaced with
Hope that this change will appear in next OTRS release 
Faithfully yours,
Artjoms
TicketSearch itself isn' t working correctly with Change Time!!!!!!!
After inspecting SQL statement sent to the databaselook what I have found:
Code: Select all
SELECT DISTINCT st.id, st.tn, st.create_time_unix FROM ticket st INNER JOIN queue sq ON sq.id = st.queue_id
INNER JOIN ticket_history th ON st.id = th.ticket_id
WHERE 1=1 AND sq.group_id IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
AND th.create_time <= '2012-06-26 17:27:21'
AND archive_flag = 0 ORDER BY st.create_time_unix DESC
It is happening because of DISTINCT and ticket_history parsing
Change in SQL statement creation should be made in /Kernel/System/TicketSearch.pm
~ at line 1294
Code: Select all
$SQLExt .= " AND th.create_time <= '"
. $Self->{DBObject}->Quote( $Param{TicketChangeTimeOlderDate} ) . "'";
should be replaced with
Code: Select all
$SQLExt .= " AND th.create_time <= '"
. $Self->{DBObject}->Quote( $Param{TicketChangeTimeOlderDate} )
. "' AND th.ticket_id NOT IN (SELECT ticket_history.ticket_id FROM ticket_history where ticket_history.create_time > '"
. $Self->{DBObject}->Quote( $Param{TicketChangeTimeOlderDate} ) . "')";

Faithfully yours,
Artjoms
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer