Versions Compared

Key

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

This article describes column values placeholders and how they can be used in the Table Grid Next Generation. 

Excerpt
hiddentrue

Create dependent columns like cascading select lists in a grid using column values placeholders.

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. 

Table of Contents
minLevel1
maxLevel3
outlinefalse
typelist
printablefalse

Placeholder syntax

To get the value from another grid column use the following placeholder syntax

'{column:<grid_column_identifier>}'

column - Grid  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. 

...

The most common use case for the column values placeholder is creating cascading lists. 

...

Simple cascading list

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

    Code Block
    select group_name from cwd_group

  • SQL query to get the list of users in a certain group. 

    Code Block
    select child_name from cwd_membership where parent_name='{column:group}'

...

Filter To Do tasks assigned to a specific user from the selected user 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 

Code Block
select parent_name from cwd_membership

Second filter Jira users in Users column, based on the value of the User Group column

Code Block
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. 

Code Block
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}’

Note

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  

...