[rt-users] Deleting tickets 2
Jesse
jesse at fsck.com
Sun Aug 5 06:38:16 EDT 2001
Be forewarned, that I'm half-way through my trip home from the west caost and rather out of it. (I just typed east coast without really seeing anything wrong with it ;) But yeah, that sounds about right. You should actually be able to do all of this from within RT's API, but feel free to build at least a first draft with the tools you know. (There's a tool to whack just one attachment in /contrib) And yes, of course we welcome anything you'd like to controbute back.
Jesse, from Newark International Airport, Gate 111
On Sat, Aug 04, 2001 at 06:25:50PM -0400, Steve Poirier wrote:
> Thanks! So, what i need to do is:
>
> select id from Tickets where Status='dead';
>
> You delete the Tickets where status is dead
>
> Loop 1 with the array of dead tickets:
> select id from Transactions where Ticket='$ticketid';
>
> Loop 2 with array of transactions for this ticket
>
> You delete all rows in Attachments where TransactionID = TransactionIDs
>
> End loop 2
>
> You delete all rows in table Transactions where Ticket='$ticketid';
>
> You delete all rows in table Watchers where Value='$ticketid';
>
> You delete all rows in table ObjectKeywords where ObjectId='$ticketid';
>
> end loop 1
>
> Is that it? If yes, i'll read the DBD-MySQL faq and build a perl script,
> is it ok if i submit it to the list after testing?
>
> Regards,
> __
> Steve Poirier
> Project Manager
> Inet-Technologies inc.
>
> ----- Original Message -----
> From: "Jesse" <jesse at fsck.com>
> To: "Steve Poirier" <steve at inet-technologies.com>
> Cc: <rt-users at lists.fsck.com>
> Sent: Saturday, August 04, 2001 2:00 PM
> Subject: Re: [rt-users] Deleting tickets 2
>
>
> > You'll also want to delete rows from the ObjectKeywords table and from the
> > Watchers table that correspond to the ticket in question. At some point,
> > I'm planning on doing up a reaper script that can do this automatically
> for
> > "dead" tickets.
> >
> >
> > On Sat, Aug 04, 2001 at 12:51:56PM -0400, Steve Poirier wrote:
> > > Sorry but after some investigation i finally figured out a way to do it.
> > >
> > > Is this correct (Simple example):
> > > select id from Transactions where Ticket=2700;
> > > +------+
> > > | id |
> > > +------+
> > > | 6962 |
> > > +------+
> > > delete from Attachments where TransactionId=6962;
> > > delete from Tickets where id=2700;
> > >
> > > Is that all i need to do?
> > >
> > > Regards,
> > > __
> > > Steve Poirier
> > > Project Manager
> > > Inet-Technologies inc.
> > >
> > >
> > > _______________________________________________
> > > rt-users mailing list
> > > rt-users at lists.fsck.com
> > > http://lists.fsck.com/mailman/listinfo/rt-users
> > >
> >
> > --
> > jesse reed vincent -- root at eruditorum.org -- jesse at fsck.com
> > 70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90
> >
> > . . . when not in doubt, get in doubt. -- Old Discordian Proveb
> >
> > _______________________________________________
> > rt-users mailing list
> > rt-users at lists.fsck.com
> > http://lists.fsck.com/mailman/listinfo/rt-users
> >
>
>
--
jesse reed vincent -- root at eruditorum.org -- jesse at fsck.com
70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90
A REAL sysadmin challenge is "resurrect five dead mailserver while so ripped
to the gills on mdma that you can't focus on any given line of text for more
than 10 seconds continuously."
-Nathan Mehl
More information about the rt-users
mailing list