Removing Deleted Tickets

I’ve received a script from Wash working in RT2. I’ve now modified it to
work with RT3, and it seems to do everything correct.

Script is attached.

ODHIAMBO Washington wrote:

purge-dead.pl (2.52 KB)

I’ve received a script from Wash working in RT2. I’ve now modified it to
work with RT3, and it seems to do everything correct.

Jonas,

I haven’t tried it yet, but will get some good use out of it. We "delete"
all spam (and we currently receive a lot of spam in RT as we have
filtering turned off right now). Thanks for the contribution.

Now, the only thing I’m missing is a way to get rid of “dead users”, i.e.
users that don’t have associated tickets. I’ve got lots of fake spam
users and as soon as I remove their deleted tickets, they won’t have any
associated tickets.

If I have a chance I will look into writing a script for this however
since I know I probably won’t have time to do this in the near future, I’m
hoping someone else has already done it… :slight_smile:

What is the correct way to go if I want to remove all tickets marked as
"deleted"?

/Jonas

“JL” == Jonas Lincoln lincoln@unit.liu.se writes:

JL> What is the correct way to go if I want to remove all tickets marked as
JL> “deleted”?

Assume you mean marked “dead” and for RT2.

Someone here posted a script to do that a while back. What I did was
add referential constraints to the database with cascading deletes,
and then I do this: delete from tickets where status=‘dead’

I posted the constraints here last week. They don’t work for mysql
with the default setup for RT2.

Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@kciLink.com Rockville, MD +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/

And just because, I found a glitch or two in it.

Now the script also handles CustomFields associated with the tickets.

But, one problem remains. How is the Groups and GroupMembers associated
with TicketIDs?

/Jonas

bill@daze.net wrote:> Jonas Lincoln lincoln@unit.liu.se wrote:

I’ve received a script from Wash working in RT2. I’ve now modified it to
work with RT3, and it seems to do everything correct.

Jonas,

I haven’t tried it yet, but will get some good use out of it. We "delete"
all spam (and we currently receive a lot of spam in RT as we have
filtering turned off right now). Thanks for the contribution.

Now, the only thing I’m missing is a way to get rid of “dead users”, i.e.
users that don’t have associated tickets. I’ve got lots of fake spam
users and as soon as I remove their deleted tickets, they won’t have any
associated tickets.

If I have a chance I will look into writing a script for this however
since I know I probably won’t have time to do this in the near future, I’m
hoping someone else has already done it… :slight_smile:


rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

purge-dead.pl (2.53 KB)