Change the Starting Case Number in FogBugz
January 10th, 2009 by Adam Wishneusky
Sometimes there arises the need to increase the starting or next case number in FogBugz. Say you have imported cases into FogBugz from another instance of FogBugz or another tool such as Bugzilla. To avoid case number conflicts, you can change the next case number with a simple API command which you can run right in your web browser.
The FogBugz API accepts both GET and POST HTTP requests, so you can do this by putting the following URLs into your favorite web browser. Note: these URLs are for windows self-hosted installations. PHP installs should use .php in place of .asp and On Demand accounts use https instead of http.
First, login using your email address and password:
http://yourfogbugz/api.asp?cmd=logon&email=youremail&password=yourpassword
Replace the italicized values with the appropriate ones. The API should give you an XML response with a token that looks something like this: 1ntkuxplkqjj6ldk325p512lar6vg2. Copy the token. Now change your staring case number by putting the following URL in your browser:
Update the starting case number:
http://yourfogbugz/api.asp?token=yourtoken&cmd=adminSetCaseNumber&ixBug=desirednumber
Replace the italicized values with the appropriate ones. Use a desirednumber that's higher than your highest imported case number and use the copied token from before for yourtoken.
On a related note, if you're clearing out the cases in your FogBugz database in order to start again without losing your projects and users, you'll want to use TRUNCATE TABLE on both your Bug and BugEvent tables in your database if you want the case number to start from 1 again.

