Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
borderColorblack
bgColorlightgrey
Excerpt

A query, used to initialize the grid when the issue is created, when the grid is reloaded using the reload button or when a dependent custom field is changed.

Note that this property is applied only on the creation of the issue.


Class

init

Property

gd.query

Formal specification

gd.query=sql query

Required

no; yes for Connected grid

Default


Version

1.0

Comment


Warning

 * Be very carefull with the queries. You might use a query which brings down the database instance, or use stored procedures which wipe the database. 

  • Make sure that you limit the context of the custom field to the projects that are effectively using the custom field. Check inline parameters method for
    more details.
    When the grid custom field is part of the field configuraiton, the gd.query will always be executed. 


  • Use gd.query to initialize the grid with values when the issue is created.
  • When defining a sql query, you have to specify gd.query.ds 
  • a query can depend on issue specific values such as customfields and issuefields.
  • Use gd.query.columns to map the results of the query to the grid columns

Example


Code Block
 
... 
gd.columns=sandwich,price,number 
gd.table=sandwich_order 
gd.query=select name,price from sandwich_menu where restaurant={customfield:10010}
gd.query.ds=gridds 
... 

In this example: customfield:10010 is a JIRA customfield listing all the restaurants for which a sandwich menu is known. 
When the select list changes, the query is run again

Reference

 gd.query.columns 
gd.query.ds 
gd.query.keepOnRefresh
inline parameters method