col.xyz.query

Specify a source to initialize a list

Class

Column

Property

col.xyz.query

Formal specification

col.xyz.query = <datasource specific query>

Required

no

Default



Version

1.0

Comment



Be very carefull with the queries. The risk exists that a query brings down the database instance, or even wipe all the data in the db. To mitigate this risk ensure that the user has only read and create table authorizations.

There are 2 sources to populate a list: 
a) a query from a database 
b) a customfield of JIRA 
The grid will know that it is either the first or the second based on the property value. If the property value starts with customfield: , the list will be populated with the custom field options, else the query will be considered as a sql query. Check for more details on the customfield query following specification: col.xyz.query - customfield 

Example



col.city=Cities  col.city.type = list  col.city.query=select cityName, id from cities order by cityName  col.city.query.ds = touristInfo



Reference

col.xyz.type = list 
col.xyz.list.size 
col.xyz.nameX 
col.xyz.valueX 
col.xyz.query.ds 
col.xyz.query - customfield

Using dynamic queries

When you create a list query, the add-on will take the first as the name and the second value as the value (which should be unique, for the purpose of being used as id, otherwise the grid will cut off all other options as duplicates).
So for instance if you have

... col.city = City col.city.type = list col.city.query = select cityname, zipcode from cities ...

 

it will store 'cityname' in the table attribute city_name and 'zipcode' in the table attribute city
(zipcode is considered as the value). If you select just one field like in

col.city.query = select cityname from cities

 

Both attributes ('city' and 'city_name') will get the selected cityname


In the case when you select more than 2 attributes, to cover Using list values in formulas  you need to make sure that
the second attribute in the select list is the value you want to store in the value column of the list.

Â