Hi all,

I have planned to clean old tickets from my OTRS database and so I have added this job in GenericAgent.pm:

 'delete-old-ticket' => {
     # get all tickets with these properties
     Queue => ['Junk'],
     States => ['closed successful', 'closed unsuccessful'],
     Locks => ['unlock'],
     # tickets older then 1 year+1 day
     TicketCreateTimeOlderMinutes => 568800,
     # new ticket properties (no option is required,
     # use just the options which should be changed!)
     New => {
       # DELETE!
       Delete => 1,
    },
  },


But when deleting ticket via ./GenericAgent.pl some are deleted and others not and this error si displayed:

- Delete Ticket (95400319/348).
DBD::mysql::db do failed: Cannot delete or update a parent row: a foreign key constraint fails at /applis/Internet/otrs-2.0.4/Kernel/System/DB.pm line 376, <DATA> line 283.
ERROR: OTRS-GenericAgent-954 Perl: 5.8.0 OS: linux Time: Fri Oct 20 13:25:22 2006

 Message: Cannot delete or update a parent row: a foreign key constraint fails, SQL: 'DELETE FROM article WHERE ticket_id = 348'

 Traceback (19737):
   Module: Kernel::System::Ticket::ArticleStorageDB::ArticleDelete (v1.31) Line: 72
   Module: Kernel::System::Ticket::TicketDelete (v1.194) Line: 480
   Module: Kernel::System::GenericAgent::JobRunTicket (v1.11 ) Line: 611
   Module: Kernel::System::GenericAgent::JobRun (v1.11 ) Line: 351
   Module: ./GenericAgent.pl (v1.36) Line: 215

I think that constraints are not managed by ArticleDelete module.. bug ? anyone have a solution ?

I use OTRS 2.0.4

Regards,

--
M. Yann Richard
yann.richard on gmail.com