Hi,
I have a requirement to further process data added from the custom tables of the 'Table grid editor' plug-in. Ideally to write a JIRA plug-in that accesses the tables and retrieves the values stored in it. I've noticed that with each custom field I create through this plug-in a new table gets created. The problem I have is to find the corresponding table to each custom field(being able to find the table without hardcoding the table name). Is there any way to do this,perhaps a table that stores the required details?
Thanks
Hello Prameesha,
The tablename is derived from the gd.tablename property and the contextid of the customfield.
Given that this add-on is manipulating data structures, we wanted to be sure that it would be harmless at all times for any data which is not related to the addon.
You could derive yourself the table name by using following query on the JIRA database
(sql to be adapted to your local database dialect - this is mysql)
* Context id can be found with
SELECT ctx.id, cf.cfname FROM jiradb.configurationcontext ctx inner join jiradb.customfield cf on ctx.customfield = concat("customfield_", cf.id) where cf.CUSTOMFIELDTYPEKEY = "com.idalko.jira.plugins.igrid:tableGridCFType"
* The tablename can be extracted from the generic configuration
SELECT ctx.id, gc.xmlvalue FROM jiradb2.configurationcontext ctx inner join jiradb2.customfield cf ON ctx.customfield = concat('customfield_', cf.id) inner join jiradb2.genericconfiguration gc ON gc.datakey = ctx.id where cf.CUSTOMFIELDTYPEKEY = 'com.idalko.jira.plugins.igrid:tableGridCFType' and instr(gc.xmlvalue, 'gd.tablename') > 0
The resulting table name is then
<configured table name> "_c" <context id>
Note that this poking around in the database does reveal implementation details which
will change in the future.
I raised therefore a new feature request in our jira to provide this information through a rest call
https://support.idalko.com/browse/IGRID-2848
Please feel free to comment on that issue.
Francis
Hi Francis,
Thanks for the reply. This was exactly what I needed to know.
Am I right in assuming that this feature would not be available in the immediate future, say within the next couple of months?
Regards,
Prameesha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.