show/hide this revision's text 13 edited body

We have logged this as a feature request. Please vote up the question above to show your support for adding this feature.


FogBugz is built around the idea of capturing and tracking everything about your project. To that end, we've made some design decisions that might seem odd at first, but actually end up making a lot of sense. It's sort of like looking for the "off" button on your iPod. For an iPod, paused is the same as off.

A closed case is, for the purposes of issue tracking, the same as deleted. It no longer shows up in filters, it's not assigned to anyone. It can be found only by filtering for closed cases or by searching for text in it specifically. We've found that once people get used to the idea of just closing a case and moving on, it never comes up again, the same way you get used to not having to manually switch off your iPod.

Most often, the cases that people are looking to delete are the ones with the title "foo" or "test" that they put in when they were starting off with FogBugz. There are two options here. First, you can close and ignore the case. Other bugs will be filed, and soon those cases will be a distant memory. Or, you can install the Case Event Edit plug-in, which will allow you to repurpose those old cases for new uses.

For customers where there might be a security or privacy issue (such as a credit card number erroneously stored in a case), we recommend running FogBugz on your own server where you have full control over the database and can excise data as necessary.

If you truly need to remove information, then removing directly from the database is the only way.

Here's how to do that:

In FogBugz 7 and earlier:

DELETE FROM Attachment 
  WHERE ixBugEvent IN
    (SELECT ixBugEvent FROM BugEvent WHERE ixBug = 1234);

In FogBugz 8 and later:

DELETE FROM Attachment
  WHERE ixAttachment IN
    (SELECT AttachmentReference.ixAttachment
    FROM AttachmentReference
    INNER JOIN BugEvent
      ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

DELETE FROM AttachmentReference
  WHERE ixAttachmentReference IN
    (SELECT AttachmentReference.ixAttachmentReference
    FROM AttachmentReference
    INNER JOIN BugEvent
        ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

If you're using MySQL, the AttachmentReference query needs to be changed to this:

DELETE FROM AttachmentReference
  WHERE ixAttachmentReference IN
  (SELECT x.ixAttachmentReference
   FROM (SELECT * FROM AttachmentReference) as x
   INNER JOIN BugEvent
     ON x.ixBugEvent = BugEvent.ixBugEvent
   WHERE ixBug = 1234);

For all versions of FogBugz:

DELETE FROM BugView WHERE ixBug = 1234;
DELETE FROM BugEvent WHERE ixBug = 1234;
DELETE FROM BugRelation WHERE ixBugTo = 1234;
DELETE FROM BugRelation WHERE ixBugFrom = 1234;
DELETE FROM Scout WHERE ixBug = 1234;
DELETE FROM TagAssociation WHERE ixBug = 1234;
DELETE FROM Duplicates WHERE ixBugDupe = 1234;
DELETE FROM Duplicates WHERE ixBugDupeOf = 1234;
DELETE FROM TitleWord WHERE ixBug = 1234;
DELETE FROM CVS WHERE ixBug = 1234;
DELETE FROM TimeInterval WHERE ixBug = 1234;
DELETE FROM Subscriptions WHERE ixBug = 1234;
DELETE FROM BugEvent WHERE ixBug = 1234;
DELETE FROM Bug WHERE ixBug = 1234;

If you want to delete all cases in a given project or group of projects, it's easy enough to put WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject IN (2,3,4)) instead of WHERE ixBug = 1234.

See also deleting old attachments and deleting email-attachments.

show/hide this revision's text 12 mysql version of attachmentreference plugin

We have logged this as a feature request. Please vote up the question above to show your support for adding this feature.


FogBugz is built around the idea of capturing and tracking everything about your project. To that end, we've made some design decisions that might seem odd at first, but actually end up making a lot of sense. It's sort of like looking for the "off" button on your iPod. For an iPod, paused is the same as off.

A closed case is, for the purposes of issue tracking, the same as deleted. It no longer shows up in filters, it's not assigned to anyone. It can be found only by filtering for closed cases or by searching for text in it specifically. We've found that once people get used to the idea of just closing a case and moving on, it never comes up again, the same way you get used to not having to manually switch off your iPod.

Most often, the cases that people are looking to delete are the ones with the title "foo" or "test" that they put in when they were starting off with FogBugz. There are two options here. First, you can close and ignore the case. Other bugs will be filed, and soon those cases will be a distant memory. Or, you can install the Case Event Edit plug-in, which will allow you to repurpose those old cases for new uses.

For customers where there might be a security or privacy issue (such as a credit card number erroneously stored in a case), we recommend running FogBugz on your own server where you have full control over the database and can excise data as necessary.

If you truly need to remove information, then removing directly from the database is the only way.

Here's how to do that:

In FogBugz 7 and earlier:

DELETE FROM Attachment 
  WHERE ixBugEvent IN
    (SELECT ixBugEvent FROM BugEvent WHERE ixBug = 1234);

In FogBugz 8 and later:

DELETE FROM Attachment
  WHERE ixAttachment IN
    (SELECT AttachmentReference.ixAttachment
    FROM AttachmentReference
    INNER JOIN BugEvent
      ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

DELETE FROM AttachmentReference
  WHERE ixAttachmentReference IN
    (SELECT AttachmentReference.ixAttachmentReference
    FROM AttachmentReference
    INNER JOIN BugEvent
        ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

If you're using MySQL, the AttachmentReference query needs to be changed to this:

DELETE FROM AttachmentReference
  WHERE ixAttachmentReference IN
  (SELECT x.ixAttachmentReference
   FROM (SELECT * FROM AttachmentReference) as x
   INNER JOIN BugEvent
     ON x.ixBugEvent = BugEvent.ixBugEvent
   WHERE ixBug = 1234);

For all versions of FogBugz:

DELETE FROM BugView WHERE ixBug = 1234;
DELETE FROM BugEvent WHERE ixBug = 1234;
DELETE FROM BugRelation WHERE ixBugTo = 1234;
DELETE FROM BugRelation WHERE ixBugFrom = 1234;
DELETE FROM Scout WHERE ixBug = 1234;
DELETE FROM TagAssociation WHERE ixBug = 1234;
DELETE FROM Duplicates WHERE ixBugDupe = 1234;
DELETE FROM Duplicates WHERE ixBugDupeOf = 1234;
DELETE FROM TitleWord WHERE ixBug = 1234;
DELETE FROM CVS WHERE ixBug = 1234;
DELETE FROM TimeInterval WHERE ixBug = 1234;
DELETE FROM Subscriptions WHERE ixBug = 1234;
DELETE FROM Bug WHERE ixBug = 1234;

If you want to delete all cases in a given project or group of projects, it's easy enough to put WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject IN (2,3,4)) instead of WHERE ixBug = 1234.

Note on MySQL:

The queries above work in MS SQL Server. MySQL will complain, however about selecting from a table that you are updating. You will need to use this technique to change them.

See also deleting old attachments and deleting email-attachments.

show/hide this revision's text 11 mysql

We have logged this as a feature request. Please vote up the question above to show your support for adding this feature.


FogBugz is built around the idea of capturing and tracking everything about your project. To that end, we've made some design decisions that might seem odd at first, but actually end up making a lot of sense. It's sort of like looking for the "off" button on your iPod. For an iPod, paused is the same as off.

A closed case is, for the purposes of issue tracking, the same as deleted. It no longer shows up in filters, it's not assigned to anyone. It can be found only by filtering for closed cases or by searching for text in it specifically. We've found that once people get used to the idea of just closing a case and moving on, it never comes up again, the same way you get used to not having to manually switch off your iPod.

Most often, the cases that people are looking to delete are the ones with the title "foo" or "test" that they put in when they were starting off with FogBugz. There are two options here. First, you can close and ignore the case. Other bugs will be filed, and soon those cases will be a distant memory. Or, you can install the Case Event Edit plug-in, which will allow you to repurpose those old cases for new uses.

For customers where there might be a security or privacy issue (such as a credit card number erroneously stored in a case), we recommend running FogBugz on your own server where you have full control over the database and can excise data as necessary.

If you truly need to remove information, then removing directly from the database is the only way.

Here's how to do that:

In FogBugz 7 and earlier:

DELETE FROM Attachment 
  WHERE ixBugEvent IN
    (SELECT ixBugEvent FROM BugEvent WHERE ixBug = 1234);

In FogBugz 8 and later:

DELETE FROM Attachment
  WHERE ixAttachment IN
    (SELECT AttachmentReference.ixAttachment
    FROM AttachmentReference
    INNER JOIN BugEvent
      ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

DELETE FROM AttachmentReference
  WHERE ixAttachmentReference IN
    (SELECT AttachmentReference.ixAttachmentReference
    FROM AttachmentReference
    INNER JOIN BugEvent
        ON AttachmentReference.ixBugEvent = BugEvent.ixBugEvent
    WHERE ixBug = 1234);

For all versions of FogBugz:

DELETE FROM BugView WHERE ixBug = 1234;
DELETE FROM BugEvent WHERE ixBug = 1234;
DELETE FROM BugRelation WHERE ixBugTo = 1234;
DELETE FROM BugRelation WHERE ixBugFrom = 1234;
DELETE FROM Scout WHERE ixBug = 1234;
DELETE FROM TagAssociation WHERE ixBug = 1234;
DELETE FROM Duplicates WHERE ixBugDupe = 1234;
DELETE FROM Duplicates WHERE ixBugDupeOf = 1234;
DELETE FROM TitleWord WHERE ixBug = 1234;
DELETE FROM CVS WHERE ixBug = 1234;
DELETE FROM TimeInterval WHERE ixBug = 1234;
DELETE FROM Subscriptions WHERE ixBug = 1234;
DELETE FROM Bug WHERE ixBug = 1234;

If you want to delete all cases in a given project or group of projects, it's easy enough to put WHERE ixBug IN (SELECT ixBug FROM Bug WHERE ixProject IN (2,3,4)) instead of WHERE ixBug = 1234.

Note on MySQL:

The queries above work in MS SQL Server. MySQL will complain, however about selecting from a table that you are updating. You will need to use this technique to change them.

See also deleting old attachments and deleting email-attachments.

show/hide this revision's text 10 fr
show/hide this revision's text 9 see also other deleting posts
show/hide this revision's text 8 added a few other tables that should also be cleaned when deleting bugs
show/hide this revision's text 7 added 201 characters in body
show/hide this revision's text 6 updated attachment queries for FogBugz 8
show/hide this revision's text 5 deleted 270 characters in body
show/hide this revision's text 4 deleted 26 characters in body
show/hide this revision's text 3 added 577 characters in body
show/hide this revision's text 2 added 641 characters in body
show/hide this revision's text 1