Versions Compared

Key

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

Table Grid Next Generation mappings are based on a table iteration. Each step present on the table iteration will match a row of the same table and its order will be the same as displayed in your exported Jira issue.

To declare a Table Grid you can do as follows:

Code Block
titleTable Grid Iteration
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Table Grid fields will go in here.
#{end}

You can also get the number of rows contained in a Table Grid by using the following mapping, this is the same mapping used in the for-iteration declaration:

Code Block
titleTable Grid Iteration Row Count
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
${TableGrid.TABLE_NAMECount}

Table Columns

In order to obtain the values contained inside a Table Grid, you can use the iteration previously mentioned:

Code Block
titleTable Grid Iteration Column
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Replace the TABLE_NAME with the Table Grids' name and COLUMN_ID with the column id.
	${TableGrid.TABLE_NAME[n].COLUMN_ID}
#{end}

The identifier can be the same as the column name, but it can also have some other value. The column ID used in the example above is the "Identifier" used while creating the Table Grids' column. This identifier can also be verified in the list of columns present in the Table Grid between parenthesis.

Column Types

In Table Grid Next Generation a column can be one of many types. This types are defined while creating the table and will not have any impact while exporting data. However, since Xporter does not know the type of each of the fields retrieved from Table Grid Next Generations, in some cases, additional formatting might be needed. The following types are the ones that might need this extra attention.

DateTime

While exporting a column which type is DateTime the time in secounds (epoch time) will be exported. To get the actual date from this we can use the following script:

Code Block
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Replace the TABLE_NAME with the Table Grids' name and DATETIME_COLUMN with the column id.
	DateTime: %{var date = new Date(${TableGrid.TABLE_NAME[n].DATETIME_COLUMN}); date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate() + ' ' + (date.getHours() - 1) + ':' + date.getMinutes()}
#{end}

Date

The Table Grids type Date will, once again, export the time in secounds, but this time without the time component. We can format the retrieved value by using a script like the one represented in the following example:

Code Block
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Replace the TABLE_NAME with the Table Grids' name and DATE_COLUMN with the column id.
	Date: %{var date = new Date(${TableGrid.TABLE_NAME[n].DATE_COLUMN}); date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()}
#{end}

Time

The Time type will return the time as the number of secounds since January 1st 1970 (the epoch time). We can format the retrieved value by using a script like the one represented in the following example:

Code Block
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Replace the TABLE_NAME with the Table Grids' name and TIME_COLUMN with the column id.
	Time: %{let date = new Date(${TableGrid.TABLE_NAME[n].TIME_COLUMN}); (date.getHours() - 1) + ':'+ date.getMinutes()}
#{end}

Boolean

The Boolean type will retrieve only 2 simple values, true or false. We can format the retrieved value by using a script like the one represented in the following example:

Code Block
collapsetrue
// You need to replace TABLE_NAME with your Table Grids' name.
#{for n=TableGrid.TABLE_NAMECount}
	// Replace the TABLE_NAME with the Table Grids' name and Boolean_COLUMN with the column id.
	Boolean: %{${TableGrid.TABLE_NAME[n].BOOLEAN_COLUMN} ? 'Checked' : 'Not Checked' }
#{end}

Other Types

The other types contained in Table Grid Next Generation are automatically formated, or already formated once retrieved, by Xporter. No further formating is needed, but, if desired, you can still format your data by using the script tags and JavaScript.