Table Grid Editor - Custom field mapping

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

0 votes
Accepted answer

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

That's a safe assumption :-)

Francis

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

412 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you