FogBugz Technical Support

A forum for technical support discussion related to Fogbugz.
The current FogBugz Knowledge Base can be found at http://help.fogcreek.com/fogbugz.

Posts by Fog Creek Employees are marked:

Documentation
Release Notes
Network Status

Adding a new category to FogBugz

[We're new FogBugz users, so please bear with me.]

Is it possible to add a new category to the built-in FogBugz list (Bug, Feature, Inquiry)?

If that's not possible, or not particularly easy, how about renaming one of the existing 3 categories?  For example, if we wanted to change "Inquiry" to "Task"... would that be easy?

Thanks,
Jason
Jason Send private email
Tuesday, January 31, 2006
 
 
Yes, edit the Category table directly in the database and you'll see what is going on...
Michael H. Pryor Send private email
Tuesday, January 31, 2006
 
 
Adding a new category can be done but it's not easy.  There are lots of places in the code where the category stuff is hard-coded that you'd need to edit.
Rob Sweet Send private email
Wednesday, February 8, 2006
 
 
It's not that hard... You just add a new row to the Category table and then you can make cases that are of that category...
Michael H. Pryor Send private email
Thursday, February 9, 2006
 
 
Adding a row works at first glance, but it is hard coded in places, for example minireports and the lang file.  You'll also end up with the default 'bug' icon.
Paul
Monday, February 20, 2006
 
 
We added a new Task category with it's own icon and own set of status values.  We also made it available for filtering.  Took about an hour (most of the time spent in making the 15x15 icon look good).

Here are the basic steps to add a Task category:
-- Add a row into the Category table.  Just use a bogus value for the default status until you give the new Category it's own set of status values:
INSERT INTO Category (sCategory, ixStatusDefault) VALUES ('Task', -1)

-- Add some Status values:
INSERT INTO Status (sStatus, ixCategory) VALUES ('Resolved (Completed)', 4)
In this case, the category value of 4 corresponds to the new record added to the category table.

-- Update the Category table so that it's default status points to the new status value:
UPDATE Category SET ixStatusDefault = 15 WHERE oxCategory = 4
In this case, the status value of 15 corresponds to the new status we added to the Status table

-- Create new icons.  The easiest thing to do is just copy/edit the sidebar-ico-bug.gif and the sidebar-ico-bug-naa.gif icons found in the website/images folder.  Name them sidebar-ico-task.gif and sidebar-ico-task-naa.gif.

-- Edit the icons.asp and add a new entry to the Select Case (ixCategory) statement in the CategoryIcon subroutine If you want to be thorough, you can add the text constant "Task" in lang.asp.  Alternatively, you could just be lazy and hardcode the text constant in the icons.asp file as in the following example: 

Sub CategoryIcon( ByVal ixCategory, sClass )
    Dim sImg, sAlt
    Select Case( ixCategory )
        Case 2:
            sImg = "sidebar-ico-feature-naa.gif"
            sAlt = FB_CATEGORY_FEATURE
        Case 3:
            sImg = "sidebar-ico-email-naa.gif"
            sAlt = FB_CATEGORY_INQUIRY
        Case 4:
            sImg = "sidebar-ico-task-naa.gif"
            sAlt = "Task"
        Case Else:
            sImg = "sidebar-ico-bug-naa.gif"
            sAlt = FB_CATEGORY_BUG
    End Select

-- Edit the miniReports.asp file and, similar to the changes made in the icons.asp file, add the new category to the Select Case (ixCategory) statement in the MiniReportCategoryIcon subroute.

-- Edit the CFilter.asp file and add the new category to the Select Case (ixCategory) statement in the AsText function as in the following example:

  Select Case (ixCategory)
          Case 1: sBugs = FB_FILTER_BUGZ
          Case 2: sBugs = FB_FILTER_FEATURES
          Case 3: sBugs = FB_FILTER_REQUESTS
          Case 4: sBugs = "tasks"
          Case Else: sBugs = FB_FILTER_CASES
  End Select

 You'll also need to modify the Get FilterOption Category section of the CFilter.asp file as in the following example:

'Get FilterOption Category
'
Set opt = New CFilterOption
opt.rgArg = Array("ixCategory")
opt.rgVal = Array( Array("1", FB_FILTER_BUGZ), _
                  Array("2", FB_FILTER_FEATURES), _
                  Array("3", FB_FILTER_REQUESTS), _
                  Array("4", "tasks"))

Of course, you could add the text contstant "tasks" to the lang.asp file if you wanted to and then use the constant.

Viola!  You now have your own category with its own icon and it even works correctly with the filter.  Of course, the next time you upgrade FogBugz you may lose your changes.  I suppose there's always a price to pay, eh?
Brian Watson Send private email
Monday, February 27, 2006
 
 
One additional note on adding a category:

You don't need to edit the MiniReports.asp file as described above because you won't get your category to show up in the Mini Reports without modifications to lots of additional files.

The Mini Reports are the "Open cases by project", "Open cases by dept", etc. tables that are visible in the left-hand side of the list view)

Not having your custom category in the Mini Reports isn't that big of a deal because you can still filter by the category in Grid View to see exactly what you want to see.

Cheers,
Brian Watson Send private email
Monday, February 27, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz Bug Tracking and Evidence-Based Scheduling.