Are there any example(s) of where the rows of the grid editor are initialized by any of the following custom fields?
select list
radio buttons
Hello Anthony,
Check out the inline parameters page
https://wiki.idalko.com/display/TGPD/inline+parameters+method
You can write a query like
... gd.query = select a, b, c, d from myTable where e = {currentuser:id} ... ... col.mylist.type = list col.mylist.query = select a, b, c from myTable where e = {customfield:10401} ...
Hope this helps,
Francis
Hey Francis, thank you for your answer. However, I'm trying to do something a little different. I'm trying to take the options from a mutli select list on an issue and initialize a table grid. I want to put each selected item from the custom field in a different row for the table grid. Is there a way to do this?
Hi Anthony - given the limited formatting capabilities of a comment, I'm adding a reply to your last remark here ...
This can be done by configuring gd.query to retrieve the selected values.An example query (here specific for mysql) would look like following snippet - with 10070 the customfield id
gd.query = SELECT cfo.customvalue \ FROM jira.customfieldoption cfo \ inner join customfieldvalue cfv \ on cfo.customfield = cfv.customfield \ and cfo.id = cast(cfv.STRINGVALUE as decimal) \ where cfo.customfield = 10070 \ and cfv.issue = {issue:id}
When hitting the reload button on the grid, the query will be run again, replacing all rows which havenot been modified. This behaviour can be adapted with the https://answers.atlassian.com/questions/29953583 property
Hey Francis, the query works, however, I am having trouble viewing the contents of the query inside of my table grid. Your query states that I have to use gd.query. However, I get an error message stating that I need to use gd.query.ds. My table configuration is as follows:
############################################# General grid properties section#----------------------------------------# gd.columns is used to define the columns which make up the grid# gd.tablename and gd.ds are used to specify where the data of the grid should be stored# It is possible to store the grid data in an external database#gd.query.ds = SELECT cfo.customvalue FROM jira.customfieldoption cfo inner join customfieldvalue cfv on cfo.customfield = cfv.customfield and cfo.id = cfv.STRINGVALUE where cfo.customfield = 10302 and cfv.issue = {issue:id}
gd.visiblerows=1gd.visiblerows=autogd.columns=Subsystemsgd.query.columns=Subsystemsgd.tablename=Subsystem_table2gd.ds=jira
############################################# Column section for the Subsystems column#----------------------------------------# Various column properties are used to specify the behaviour# of the column (such as width, type, etc.)#
col.Subsystems=Subsystemscol.Subsystems.name=Subsystemscol.Subsystems.type=string
My table grid does not display the results from the query. How can I get it to display the results?
gd.query.ds is used to specify on what data source the query should run. https://wiki.idalko.com/x/64Lg gd.query is used to specify the query itself https://wiki.idalko.com/x/zoLg So your grid configuration should look like gd.query.ds = jira gd.query = select cfo.customvalue ... (When pretty formatting a query make sure you use the \ line terminator)
Hey Francis, I made the changes and now get the following error: "Database error occurred while executing query "null": could not execute query" ############################################ # General grid properties section #---------------------------------------- # gd.columns is used to define the columns which make up the grid # gd.tablename and gd.ds are used to specify where the data of the grid should be stored # It is possible to store the grid data in an external database # gd.tablename=Subsystem_table2 gd.ds=jira_ds gd.query.ds=jira gd.query = SELECT cfo.customvalue \ FROM jira.customfieldoption cfo \ inner join customfieldvalue cfv \ on cfo.customfield = cfv.customfield \ and cfo.id = cfv.STRINGVALUE \ where cfo.customfield = 10302 \ # and cfv.issue = {issue:id} gd.visiblerows=1 gd.visiblerows=auto gd.columns=Subsystems ############################################ # Column section for the Subsystems column #---------------------------------------- # Various column properties are used to specify the behaviour # of the column (such as width, type, etc.) # col.Subsystems=Subsystems col.Subsystems.name=Subsystems col.Subsystems.type=sequence What am i doing wrong?
I missed your comment - sorry about that. How relevant is it to further the discussion ?
It looks like you're new here. Sign in or register to get started.