Link FogBugz Cases to Kiln Reviews and Changesets


When you add FogBugz to Kiln, you get a full-circle audit history with your cases and your code.

Linking FogBugz Cases to Changesets

Kiln, On Demand and 2.9 or later

As of Kiln 2.9, code reviews are no longer stored as a FogBugz case. There are a few ways to associate a FogBugz case with a Kiln changeset and/or review.

Manually via the “Add a case” Button

Link a case to a changeset when viewing the changeset in Kiln. At the top right, click “Add a case“, and in the search box enter the case number or case title. Click the “Add” button to associate the case to the changeset.

Add a case by case number
Add a case by case number


Add a case by case title
Add a case by case title

Removing a Case Association

In the event a changeset is associated to an undesired case, or vice versa, remove the case association. Click “# case” or “# cases” button where ‘#’ is the number of associated cases, then click the red encircled ‘X’ to remove the case from the changeset. This can be done regardless of manually or automatic case association.

Click the red X to remove the case association
Click the red X to remove the case association

Automatically Linking via Commit Message

Before you push your code to Kiln, ensure your commit message contains at least “case 123“, where “123” is an example case number. When Kiln sees this, it will automatically associate this changeset to case 123.

git commit -m "fixing case 123"

Kiln provides several other options for your commit messages to automatically link to cases. Read more below.

When this association is done, the commit message automatically hyperlinks the case number to your FogBugz account. This can help in navigation between changesets and cases.

Automatic hyperlink to case in FogBugz

Automatic (hyper)linking from Code Review to Case

Similarly to how a Code Review number can be mentioned in a case comment, you can mention a case number in a Code Review comment. Simply enter the text “case 493”, for example, and your comment will automatically hyperlink to the case 493.

Automatic hyperlink from review comment
Automatic hyperlink from review comment to a case

Kiln 2.7 and earlier

To associate FogBugz cases and Kiln code reviews, simply mention some variant of “review 123″, “case 123”, “bug 123”, or the like in your commit message. Kiln will automatically associate it with the corresponding case in FogBugz. These forms are all completely identical, as far as Kiln is concerned; just choose whichever one gives you the best readability.

If the bug you mention is a review, then your changeset will automatically be added to the review if possible (i.e., it’s in a related repository).

Cases associated with changesets in a review are also associated with any reviews that changeset is in automatically.

If you forget to link a changeset to a case at at commit time, Kiln allows you to associate cases with changesets after the fact. Simply click on the “Add Case” button when viewing the changeset you’ve just pushed.

Linking FogBugz Cases to Code Reviews

To associate a FogBugz case with a Kiln Code Review, that means that the case must be associated with a changeset where that changeset is part of a Code Review. The above instructions show how to associate a case to a changeset.

Once the changeset exists in Kiln, ensure that you associate the changeset with the Review!


What does Kiln use to parse commit messages for case association?

Here is the regular expression, case insensitive, we use to parse commit messages for case numbers:

Kiln On Demand
\s*((Bug[sz]?\s*IDs?)|cases?)\s*[#:; ]+(((?\d+)([ ,:;#](and)?)*)+)

Kiln For Your Server
\b(?(review|case|bug[zs]?(\s| )*(id)?:?)s?(\s| )*([#:; ]| )+)((([ ,:;#]|and)*)(?\d+))+