Table Grid Next Generation mappings are based on the columns you create for your table grid. Each row present on the table grid from the issue will match with a row of the iteration and the order will be the same as displayed in your exported Jira issue.
Definition
To declare a Table Grid you can do as follows:To export the data you have in your Table Grid, you need to use the following definition
Code Block |
---|
title | Table Grid Iteration |
---|
collapse | true |
---|
|
//You can get the number of rows contained in a Table Grid by using the following mapping
${TableGrid.TABLE_NAMECount}
#{for n=TableGrid.TABLE_NAMECount}
// Table Grid fields will go in here.
${TableGrid.TABLE_NAME[n].COLUMN_ID}
#{end} |
Info |
---|
|
- You need to replace the TABLE_NAME with your Table Grids' name.
- You need to replace the COLUMN_ID with the column id.
- The COLUMN_ID 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.
|
DateTime
Helpers
In order accurately export some mappings with the right format, in this section we present you some helpers to properly export the information in your table grid:
Date Time
While exporting a column which type is DateTime the time is going to be exported in seconds(epoch time) will be exported. To get the actual date from this we and if you want to get the right format of the date and time you can use the following script:
Code Block |
---|
title | DateTime Formating Example |
---|
collapse | true |
---|
|
// Replace the TABLE_NAME with the Table Grids' name and DATETIME_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
DateTime: %{var date = new Date(${TableGrid.TABLE_NAME[n].DATETIME_COLUMN}); date.getFullYear() + '/' + (date.getMonth() + 1) + '/' + date.getDate() + ' ' + (date.getHours() - 1) + ':' + date.getMinutes()}
#{end}
|
DateThe Table Grids type Date will, once again, export the time in seconds, 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
While exporting a column which type is Date the date is going to be exported as a number(epoch time) and if you want to get the right format of the date you can use the following script:
Code Block |
---|
title | Date Formating Example |
---|
collapse | true |
---|
|
// Replace the TABLE_NAME with the Table Grids' name and DATE_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
Date: %{var date = new Date(${TableGrid.TABLE_NAME[n].DATE_COLUMN}); date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate()}
#{end}
|
TimeThe Time type will return the time as the
While exporting a column which type is Time the time is going to be exported as a number of seconds since January 1st 1970(the epoch time) . We can format the retrieved value by using a script like the one represented in the following exampleand if you want to get the right format of the date you can use the following script: Code Block |
---|
title | Time Formating Example |
---|
collapse | true |
---|
|
// Replace the TABLE_NAME with the Table Grids' name and TIME_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
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,
Checkbox
While exporting a column which type is Checkbox you are going to receive a Boolean that can be true or false. We We can format the retrieved value by using a script like the one represented in the following example: Code Block |
---|
title | Boolean Formating Example |
---|
collapse | true |
---|
|
// Replace the TABLE_NAME with the Table Grids' name and BooleanBOOLEAN_COLUMN with the column id.
Boolean#{for n=TableGrid.TABLE_NAMECount}
Checkbox: %{${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.
Sample Table Grid Export
Attachment
While exporting a column which type is Attachment you are going to receive the URL of the attachment. However, if your attachment is an image you can export the image and not the URL, using the following script:
Code Block |
---|
title | Boolean Formating Example |
---|
collapse | true |
---|
|
// Replace the TABLE_NAME with the Table Grids' name and ATTACHMENT_COLUMN with the column id.
#{for n=TableGrid.TABLE_NAMECount}
Attachment: !{${TableGrid.TABLE_NAME[n].ATTACHMENT_COLUMN}}
#{end}
|
Example