Table Grid Editor - Custom field mapping

Prameesha Samarakoon June 2, 2014

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

1 answer

1 accepted

1 vote
Answer accepted
francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 5, 2014

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

Prameesha Samarakoon June 8, 2014

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

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 8, 2014

That's a safe assumption :-)

Francis

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events