1

1

Is there an API to get the list of tag names and the number of cases? Currently, going to Report | Tags, you can get the data that I want, but I need to do it from a plugin.

Thank you!

BTW, if FogCreek (or anyone else) is developing a Tag cloud plugin, please let me know so that I don't waste time. :-)

flag

1 Answer

1

We do have a case open for a tag cloud plugin, but it isn't on the immediate road map. You can see the status here in this post.

The way I would retrieve this data in a plugin is via a generic database query with the CSelectQuery class. Plugins can perform read-only queries on any table in FogBugz, and write-queries on the plugin's own tables. Make sure that all your queries use fully-qualified column names in all SQL:

    CSelectQuery select = api.Database.NewSelectQuery("Tag");
    select.AddInnerJoin("TagAssociation","on TagAssociation.ixTag = Tag.ixTag");
    select.AddSelect("count(distinct TagAssociation.ixBug) as nBugCount, Tag.sTag as sTag");
    select.AddGroupBy("Tag.sTag");
    DataSet ds = select.GetDataSet();
link|flag
Thanks Adam. I ended up doing it slightly different, but at the end is the same results. – Totem Jun 23 2010 at 20:22
Great to hear! :) – adambox Jun 28 2010 at 15:09
@totem Is there any way you could share your solution with me? We are thinking of developing a similar plugin, but there's little sense in re-creating the wheel. if we don't have to. – cdeszaq Aug 12 2010 at 14:35
remember you can always share your plugin in the Gallery if you wish: fogcreek.com/FogBugz/plugins – adambox Aug 16 2010 at 14:02
Hi cdeszaq, I just saw this comment to my original post, sorry for not replying earlier. I've had to put the work on hold for a bit, and I remember having some issues that I brought up to FogCreek...let me dig it up again and see how we can share. Would you be available to contribute? – Totem Oct 16 2010 at 19:51
show 1 more comment

Your Answer

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