Cleanup Tickets

Moderator: crythias

Locked
BenI
Znuny newbie
Posts: 72
Joined: 18 Mar 2014, 13:09
Znuny Version: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Cleanup Tickets

Post by BenI »

Good day,

OTRS 5
CentOS 7.1
Apache 2.4.6
MySQL 5.5.44

I am trying to cleanup our otrs system before going into production and ran these sql scripts as suggested by http://itsm-demo.otrs.com/otrs/public.p ... ;ItemID=54, however two statements are failing:

sql> delete from article;
Failed to execute SQL : SQL delete from article; failed : Cannot delete or update a parent row: a foreign key constraint fails (`otrs`.`article_flag`, CONSTRAINT `FK_article_flag_article_id_id` FOREIGN KEY (`article_id`) REFERENCES `article` (`id`))

sql> delete from ticket;
Failed to execute SQL : SQL delete from ticket; failed : Cannot delete or update a parent row: a foreign key constraint fails (`otrs`.`article`, CONSTRAINT `FK_article_ticket_id_id` FOREIGN KEY (`ticket_id`) REFERENCES `ticket` (`id`))

What can I do in this case?

Regards,
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Cleanup Tickets

Post by wurzel »

Hi,

do not change database directly.

Use Generic Agent for that.


Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
BenI
Znuny newbie
Posts: 72
Joined: 18 Mar 2014, 13:09
Znuny Version: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Cleanup Tickets

Post by BenI »

Hi Flo,

How do I do that?

Regards,
otresi
Znuny newbie
Posts: 84
Joined: 02 Sep 2014, 10:49
Znuny Version: OTRS 5.0.8

Re: Cleanup Tickets

Post by otresi »

Hi,

Go to Admin-Generic Agent-Create Job and than define schedule, ticket folter, ticket action..
OTRS 5 /
BenI
Znuny newbie
Posts: 72
Joined: 18 Mar 2014, 13:09
Znuny Version: 5.0.19
Real Name: Ben Ipinge
Company: Telecom Namibia

Re: Cleanup Tickets

Post by BenI »

Good day,

Thanks for the pointer. I would like to define the steps I took to create the job.

Go to Admin > GenericAgent > Add Job

1. Provide a Job Name
2. Event based execution (single ticket), add event trigger Ticket - TicketDelete
3. Select Tickets, for Ticket# enter *
4. Execute Ticket Commands, changed option "send agent/customer notifications.." to No. And Delete Tickets to Yes
5. Submit

That's it, run the job and all tickets should be deleted.
Locked