0

Hi, I'm using the FogBugz XML API to create a report of Kiln code reviews. When I include the "events" column, I get a lot of great info about items in the review - but I'm not able to discern the hierarchy of the events. For example, one user posts a comment, to which another user posts a reply. In Kiln, the reply is shown indented - so it somehow knows that it's a reply to the prior post. But as far as I can tell, the API doesn't include that relationship binding.
Is it there somewhere? If not, that would be a feature request. I'm using version 8.4.90. Thanks, Mike

flag

1 Answer

0

The hierarchy of bug event replies for Code Reviews in Kiln is actually stored and maintained entirely by Kiln and the Kiln FogBugz Plugin, not FogBugz itself.

While Kiln has its own API, code review bug events are not currently exposed through it. If you'd like to see this added to the official Kiln API, here is the feature request in the Kiln support site.

To workaround this, you could write a FogBugz plugin that read's the BugEventReplies table used by the Kiln Plugin directly.

WARNING: This is an internal Kiln Plugin table, and as such, might change at any time without warning and cause your code to burst into angry flames of sadness and despair. This is not in any way a supported means of getting at this information. You have been warned.

var sb = new StringBuilder();
var query = api.Database.NewSelectQuery(
    api.Database.PluginTableName("KilnPlugin@fogcreek.com", "BugEventReplies")
);
var ds = query.GetDataSet();
foreach (DataRow row in ds.Tables[0].Rows)
{
    sb.AppendFormat(
        "<p>ixBug:{0}<br />ixBugEvent:{1}<br />ixBugEventInReplyTo:{2}</p>",
        row["ixBug"].ToString(),
        row["ixBugEvent"].ToString(),
        row["ixBugEventInReplyTo"].ToString()
    );
}
return sb.ToString();
link|flag
Thanks, this is very helpful. As we've looked at our needs, and the various API's available to us, we've started to think that maybe implementing a FogBugz plugin would give us the most flexibility. What I'm hoping is that there are Kiln defined implementation of IPluginDatabase which our plugin could access directly. If so, is a schema of the Kiln tables available? Thanks! Mike – Mike Hedman May 19 2011 at 16:40
@Mike The Kiln plugin table schema is not published and is not a supported means of getting at the information you're after. That being said, I've updated my answer with some sample code that will read the table you're interested in. – db May 20 2011 at 18:54
Thanks, While this is an internal Kiln Plugin table, your access is a little cleaner than where we started...direct access to this table via straight MySql calls. This is great. Once we get a little further down the road, I'll make a formal feature request (once we know what we really want!!). Thanks! – Mike Hedman May 24 2011 at 20:50

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.