1

1

Hi,

I'm working on a plugin and I would like to get the data from custumfield plugin.

In a perfect world, the user will be able to specified the columns he wants in configurations file or with check boxes. I saw that we can join tables to a bug using the IPluginBugJoin but I'm getting and error

"FogCreek.FogBugz.Exception.FogBugzException: is not a valid table to include in a SQL join, because it is not part of this plugin's schema."

Here's my code:

public string[] BugJoinTables()
    {
        return new string[] { api.Database.PluginTableName("CustomFields@fogcreek.com",  "custombugdata")};
    }

And I try to get the data with something like

sVariable = Bug.GetPluginField("customfields@fogcreek.com", "sColumnName").ToString();

Thanks

flag

2 Answers

1

Update 1: as of FogBugz 8, plugins can access other plugins via the CAllPluginsApi, documented here.

Update 2: Fog Creek authored plugins now run in the FogBugz app domain, so the CAllPluginsApi will likely fail to get you access to Custom Fields as your plugin will not be in the FogBugz app domain. Use this method instead.


As of the current version of the FogBugz Plugin API, a plugin cannot access a table (or really any other data) belonging to another plugin. If you are simply trying to use Custom Fields to create a field that your plugin needs, then the thing to do is to use the BugField library (see [your FogBugz install]/PluginUtils), which makes adding new fields to cases really easy. If you really do need to access CustomFields data, please tell us a little more about your use case, or email customer-service@fogcreek.com if you don't want to discuss it in this forum.

link|flag
0

I get the answer while I was trying to solve another problem....

Customfields are automatically Join when you use CBugQuery, but you have to add the select.

CBugQuery bugQuery = api.Bug.NewBugQuery();
bugQuery.AddSelect("customFieldColumnName");
CBug[] bugs = bugQuery.List();

How can we get the sColumnName from the customFields table ?

This is the only thing I need now.

link|flag
FogBugz 8 introduced a new Plugin API, CAllPluginsApi which lets your plugin interact with other plugins. Take a look at the documentation here: developers.fogbugz.com/default.asp?W184 – adambox Oct 26 2010 at 21:31
update: recent changes in how we manage app domains and moving the fog creek-written plugins into the FogBugz app domain means that other plugins trying to talk to Custom Fields via CAllPluginsApi will fail – adambox Sep 21 at 20:30

Your Answer

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