This article describes column values placeholders and how they can be used in the Table Grid Next Generation. Column values placeholders allow you to create dependencies between the grid columns.
For example, a cascading list that filters column data based on the value from another column.
You can write the placeholder in a query to get dynamic list options that will depend on the value set in another grid column.
Placeholder syntax
To get the value from another grid column use the following placeholder syntax
'{column:<grid_column_identifier>}'
column - Grid column element that helps to distinguish the column placeholder from the Jira value placeholder
<grid_column_identifier> - the identifier of the column which value you want to use in order to filter data.
For example, get a value from the column where the identifier is user.
{column:user}
SQL query with the column value placeholder to get a summary of all issues assigned to the user, selected in the user column
select summary from jiraissue where assignee = ‘{column:user}’
Be sure to use quotes as on the example below to get the correct value.
Examples
The most common use case for the column values placeholder is creating cascading lists.
Use case
You have a grid with two select list columns and you want to display options in the second select list depending on the value in the first column.
You can add dynamic options to your select list and query data from the custom field using Jira values.
Pre-requisites
- Single select list column User Group with dynamic options populated from the Jira database
- Single select list column User with dynamic options populated from the Jira database and filtered by the value selected in the User Group column.
Solution
Filter options in a User column with the help of column value placeholder
SQL query to get the list of user groups from the Jira data source
select group_name from cwd_group
SQL query to get the list of users in a certain group.
select child_name from cwd_membership where parent_name='{column:group}'
Use case
Filter tasks assigned to a specific user based on the username selected in another grid column.
You have a grid with 3 select lists columns and you want to display options in the User select list depending on the user group selected in the first column.
Then based on the user selected in User column populate the list of tasks assigned to this user.
Pre-requisites
- Single select list column User Group with dynamic options populated from the Jira database
- Single select list column User with dynamic options populated from the Jira database and filtered by the value selected in the User Group column.
- Multi-select column To Do with dynamic options populated from the Jira database and filtered by the value selected in the User column.
Solution
Display tasks assigned to a specific user in a dynamic multi-select list based on the user group.
First, get a list of user groups from the Jira database using dynamic options for the User Group select list
select parent_name from cwd_membership
Second filter Jira users in Users column, based on the value of the User Group column
select child_name from cwd_membership where parent_name='{column:group}'
Then populate the To Do list with Jira issues' keys using a dynamic multi-select list based on the User value selected in the previous column.
select concat(p.pkey, ‘-’, ji.issuenum) as key from jiraissue ji inner join project p on ji.project = p.id where ji.assignee=‘{column:user}’
Cascading list columns use dynamic options that are dependent on each other. In case you need to avoid the dependency combine status and dynamic options.
See also
Using grid to create invoices and manage quotes