Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

KeyUsage
issue values Issue values can be reused in queries to build grids in a dynamic way
grid reload 
gd.visiblerowsspecify how many rows a grid should contain
Use visiblerows to size the height of the grid, expressed in number of rows. 
For instance

 

  • gd.visiblerows = 10 will show 10 rows of normal height
    Note that the height is calculated from the normal height and not expand automatically
  • gd.visiblerows = auto is used to expand the grid automatically based on the number of normal rows.

The calculation will take into account the other vertical size properties set by

gd.trackingWhen enabled, adds 4 tracking columns to the grid table to know who and when a grid row has been added and/or updated.
Following columns are added to the gridtable

 

  • DT_CRE: Row creation date
  • DT_UPD: Row last update date
  • JIRA_USER_CRE: userid of user who created the row
  • JIRA_USER_UPD: userid of user who updated the row

The tracking columns are added only when tracking is enabled.

If the gridtable was already used prior the enablement of the tracking feature, data (especially the create date and create user) will be null.

gd.tablenameProvide the base name of the grid table
  • the property gd.tablename replaces the now deprecated gd.table property. 
  • If no tablename is given, no table will be created in the database and the griddata will not be persisted.
    • Data is stored in an in-memory database, which gets purged when JIRA is restarted or the plugin reenabled.
  • if a table name is given, the gridds datasource must be available and configured. 
  • From v1.3 onwards, you can also specify gd.ds=jira to store the gridtable in the same database as used by JIRA.
  • the resulting table name will be a combination of the base name of the grid table and the customfield id.
gd.table - deprecatedProvide the base name of the grid table
  • If no tablename is given, no table will be created in the database and the griddata will not be persisted.
    • Data is stored in an in-memory database, which gets purged when JIRA is restarted or the plugin reenabled.
  • if a table name is given, the gridds datasource must be available and configured
  • the resulting table name will be a combination of the base name of the grid table and the customfield id.
  • if you create multiple contexts for the same table grid custom field, make sure that you name each table differently
gd.sample.sizeGenerate a number of rows with randomly generated content for each of the columns such that a grid can be tested.
This property is handy if you want to see how the grid will look like when data is available.

 

Note that the data will be persisted in the gridtable if there is one.

gd.rownumbersIf this option is set to true a new column at the left of the grid is created containing the sequence number of the row in the grid.
This is mainly a visual aid to know which row you are working with

 

  • This number is starting from 1.
  • The value is not persisted
gd.readonlyWhen you want to use the grid for displaying purposes only
An alternative to gd.readonly is to create a specific issue view screen and add the grid on this view screen. Grids on view issue edit screens are readonly by default.
gd.query.rowUse this property to initialize a grid with static data.
When you need to initialize your grid with static data.
gd.query.parametersAllows to make the query, which initializes the grid, dependent on custom field values of the containing issue.
  • the gd.query can contain parameters that are marked {0}, {1}, {2}...,
  • each value {n} will be replaced with parameter value from gd.query.parameters, where the first parameter is labelled {0}.
  • an issuevalue is a value of the containing issue
  • when you need to quote the parameter (as it is a string), use single quotes ('), as this is accepted by all databases.

Check the issue values page for an overview of all the issue values which can be used.

Check the grid reload page which details how the grid will be refreshed when the dependent parameters change.

gd.query.keepOnRefreshspecifies which rows can be removed when refreshing the grid
As explained in grid reload, rows in a grid can be refreshed by either clicking on the refresh toolbar button, or by modifying a value of a dependent customfield.

 

The grid will then reload the data as detailed in the gd.query
The parameter gd.query.keepOnRefresh allows to specify what should happen with the existing rows.

  • gd.query.keepOnRefresh = All
    All rows are kept, no data is removed
  • gd.query.keepOnRefresh = Modified
    Only the modified rows are kept. A row is considered modified if a user changed some of its values during the current or previous edit. The rows which have not been modified will be removed. This is the default setting.
  • gd.query.keepOnRefresh = None
    All rows are removed before reloading.
gd.query.dsSpecify on which datasource a query needs to be run.
The datasource name can be defined through the database details.
gd.query.columnsUse this property to specify which columns should be initialized with the results of a query.
This property will map the results of the query to the corresponding column in the same order.
gd.querySpecify a query which will be used to initialize the grid
Icon

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.

  • 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 isuefields. These values are specified through a gd.query.parameters
  • Use gd.query.columns to map the results of the query to the grid columns
gd.pagination.sizeSpecifies the number of rows on a single grid page
gd.minDisplayRowHeightMinimum height of a row expressed in pixels
gd.minDisplayRowCountMinimum number of rows to display.
The height of the grid is calculated based on the normal height of a row. You might end up displaying only 1 row, although the minDisplayRowCount is larger, in case the row is expanded by its content.
gd.minDisplayRowCount must be smaller than gd.maxDisplayRowCount

 

gd.visiblerows must be set to 'auto'.

gd.minDisplayGridHeightMinimum height of a non collapsed grid expressed in pixels
gd.maxDisplayRowHeightAllows to limit the height of a row - for instance when it contains large chunks of text.
gd.visiblerows must be set to 'auto'. 
Number is expressed in pixels
gd.maxDisplayRowCountmaximum number of rows to display
Setting the maxDisplayRowCount property to a larger value then the gd.paginationsize, you will not get a vertical scroll bar.
gd.maxDisplayGridHeightMaximum height of a non collapsed grid expressed in pixels
gd.visiblerows must be set to 'auto'.
gd.filterEnable filtering capabilities on the grid such that a user can filter out rows based on a search term
The user can enter data in the filter specification text field on top of the column. Filtering is done on the content.
gd.extraHeightAdd some extra space below the last row, to avoid that the horizontal scroll bar potentially overlaps the last row.
the property value is expressed in pixels. The horizontal scroll bar takes 22 pixels, so normally you would 
use 23 as value, but you can add more if needed.
gd.emptyRowsUse this to initialize the grid with a number of empty rows. Columns are initialized with their default value
gd.delete.confirmationWhen enabled, the grid will ask for confirmation before deleting a set of rows using the 'delete non modified' or 'delete duplicates'
gd.delete.allowedAllow or disallow users to delete individual rows on a grid
gd.columnsspecifying what columns should be displayed on the grid
  • the column id will be used to specify the column details.
  • The order of the columns in this property is used to order the columns on the grid display.
gd.cleanupTableDelete rows from the gridtable when containing issue is deleted.
When an issue is deleted, you have the option to keep the corresponding griddata (or not)
gd.allowAddRowsEnable or disable the possibility to add rows
Set the allowAddRows property to false if you want to setup a static grid, having a couple of rows for which the columns need to be edited
ds.xyz.connection.type = postgresUse this to create a database source which connects to a postgres database.
ds.xyz.connection.type = oracleUse this to create a database source which connects to an oracle database.
ds.xyz.connection.type = mysqlUse this to create a database source which connects to a mysql type of database.
datasource.namesdefine the datasources in use in this grid. Further specified in database detail properties

The datasource names can be used in the different gd.query.ds and col.xyz.query.ds properties. When you define a gd.table - deprecated property (where you want to store data of the grid), you have to define a gridds data source. You can define multiple sources for retrieving data. There is one special datasource jira. This datasource doesn't need to be explicitely defined as the plugin does it for you. It represents the database where JIRA is storing its data. In version 1.1 of the plugin we support following databases

  • Oracle
  • Mysql
  • Postgres
  • MS SQL Server 2008

Note that in 1.12 we introduced Datasource Specifications which provides a simple form to define datasources and reuse them in multiple grids.

 

col.xyz.widthSpecify the width of the column in pixels
  • The width is expressed in pixels
  • behaviour depends on the underlying field and available screen estate.
    The grid plugin tries to come up with an appropriate width of a column depending on the underlying type.
col.xyz.valueXSpecify a value for a specific entry in a list
If a value is not given, the name will be used
col.xyz.nameX and this property can be used both for lists as for radio buttons
col.xyz.uniqueSequenceThis property defines if the sequence is unique (is restarted) for each Jira issue or not.
When uniqueSequence is true, the next id is allocated on an issue to issue basis.
When uniqueSecuence is false, the next id is allocated based on the number of rows in the gridtable.
col.xyz.uncheckedWhen the checkbox is unchecked - show this value
col.xyz.type = textareaThis type allows the user to enter multiple lines of text
It is stored as a CLOB, (TEXT in case of MySQL)
URL's are rendered as hyperlinks
col.xyz.type = stringThe column is used to enter a single line of text.
the field is stored as a varchar(255)
URL's are rendered as hyperlinks
col.xyz.type = sequenceGive each row in the grid a unique id.
A sequence is a number associated to a row.
For each gridtable, a sequence can either be unique for each issue, or unique overall. A sequence is stored as an integer in the gridtable.

 

The sequence prefix is used when the grid values are showed in a grid view or when printed or exported to xml or word. The sequence number of a row is allocated when an issue modification is persisted (during create or edit)
When uniqueSequence is true, the next id is allocated on an issue to issue basis. When uniqueSecuence is false, the next id is allocated based on the number of rows in the gridtable.

col.xyz.type = radioTo present a radio button group to the user
Just like a dropdown list, a radio button column can be initialized with either

 

col.xyz.type = numberUse this when the column should store number fields with a decimal (such as 1.5, -212.34 ...)
The column values are stored as a double in the gridtable
col.xyz.type = listCreate a dropdown list which is either initialized using a static list or using a query.
type = list is the most versatile type given the different methods of initializing the values.

 

col.xyz.type = integerUse this when the column should store plain integer number fields such as 1234, -789, ...
col.xyz.type = dateFormats the column as a date. When editing a cell, brings up a calendar popup.
Currently we support only following date format 
Dates are by default displayed as yyyy-mm-dd
Check col.xyz.formatDate for more options to format the date
col.xyz.type = checkboxShow checkbox options when editing a cell.
You can have only one checkbox per column cell. 
The corresponding attribute in the gridtable has type 'bit'.
col.xyz.typeSpecify what type of values can be stored in a column, defines the behaviour of the plugin.
  1. Additional parameters can be defined for each of the different types.
  2. if no type is specified, it is assumed to be a string.
col.xyz.tooltipAdd a short explaination what is expected to be filled in a column
col.xyz.summaryAdds an additonal row with a summary of the column. 
This summary can be either 'sum', 'avg', 'count', 'min', 'max' or just a label such as 'total:'

A summary on a column of type string has no effect, unless it is a label
col.xyz.sortableSpecify if a column is sortable or not
col.xyz.sequencePrefixUse this label to prefix the sequence number when viewing the rows in a grid
col.xyz.rowsSpecify the number of lines of the textarea when editing a cell of a textarea column
The height of a textarea field when viewing a grid depends on the amount of text in the cell. It will autoexpand.
col.xyz.requiredSpecify if a column can be empty or not
col.xyz.query.parametersInject parameters in the query used to build the content of a dynamic list.
Used when you want to provide a different list of options depending on context parameters

As requested on uservoice
It is now possible to adapt the content of a dynamic list depending on the value of the issue or custom field.
col.xyz.query.dsWhen a list is initialized with a query, use this property to specify which database should be used.
The first attribute in the query will be used as name (or label) of the list option, the second attribute as value.

 

If no second attribute is given, then the first attribute is taken as value.

col.xyz.query - customfieldWhen you want to reuse options provided in a custom field
The option value will be used both as label and as value in the table
col.xyz.querySpecify a source to initialize a grid
Icon

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

When specifying a sql query, such as 
col.xyz.query=select city, zip from cities

following applies

  • col.xyz.query.ds needs to be defined.
  • The first attribute in the select is interpreted as the name (or label) of the list option value, the second - optional - attribute is interpreted as its value.
    In case the select returns a single column, its value will be used as the name and the value of the list option.
col.xyz.nameXUsed to specify the label of a static list entry
This property goes hand in hand with the col.xyz.valueX 
If no value is given, the list value will be the name.
col.xyz.name=<tracking field>When you want to display in a grid the values of a tracking field. 
(A tracking field keeps track when and by whom a row in the grid table has been created / updated)

Column properties are ignored when the column is mapped to one of the tracking fields. 
such as col.xyz.type, col.xyz.defaultValue, ...

 

Ensure that tracking has been enabled by specifying the gd.tracking property.
The parameter is case sensitive. If you sepecify col.xyz.name = dt_cre, 
the plugin assumes you are referring to another attribute

col.xyz.nameWhen the name of the attribute in the grid table (in the database) should be different from the column identifier
  • When adding this property to an existing configuration a new column will be created in the grid table.
  • Not all names are allowed - it all depends on the database capabilities If the name is one of the database reserved words, a 'u' is added in front of the name.
col.xyz.minValueSpecify a mininum value for a number or integer column. Will show an alert if the number is lower than the minValue
col.xyz.maxValueSpecify a maximum value for a number or integer column. Will show an alert if the number is higher than the maxValue
col.xyz.maxLengthLimits the number of characters which can be entered in a text or textarea column.
col.xyz.list.sizeIn case of a static list, specify the number of list entries
col.xyz.initialValueSet the first value of a sequence
col.xyz.hiddenHide a column from displaying on the grid
An alternative approach is to remove the column specification from the gd.columns property.
col.xyz.formulaUse the formula property to calculate the content of a column.
String, math and conditional expressions are supported

  • A column with a formula is read only
  • When the column containing the formula is a string, values are trimmed to 254 chars
col.xyz.formatDateFormat the date when a column is a date type
col.xyz.editableUse this to indicate if a column should be readonly or not
col.xyz.defaultValueSpecify a default value for a column when adding one or more rows
Checkboxes are by default unchecked. If you need to have it checked use
col.willAttend.defaultValue = checked

 

a defaultValue of a list is its value

col.xyz.defaultDateinitialize a date column with a date calculated from now.
col.xyz.colsSpecify the number of characters on a single line when editing a cell of a textarea column
  1. The value is expressed in number of characters
  2. The width of the column has priority over the width implied by the number of characters.
col.xyz.checkedWhen the checkbox is checked - show this value
col.xyz.cascadeWhen you want to cascade the selection from one list to another list
When the cascade property is defined on a source list, then the plugin will provide the selected name and value of the source list as a parameter to the target property.

 

The parameter can then be used by the target list query to select the relevant list options.

col.xyz.autocompleteWhen you want a type-ahead drop down list allowing to filter on specific values in the list.
col.xyzDefine the column header of a single column
For each columnidentifier in the gd.columns property, a single 
col.

 

must be defined specifying the header of the column.

  • No labels