When importing data into the grid table - you find out that the content is showed when editing the issue but not when viewing the issue
The table grid editor is storing the row data into a database table, and stores the number of rows into the corresponding customfield value.
Whenever JIRA displays an issue, it will only display the custom fields where the value has been set.
It is therefore very important that the custom field value corresponding to the grid has a value stored in it. This value gets updated automatically whenever the grid is initialized during the creation and/or updating of the issue.
Whenever the content of the table is loaded directly through SQL, this customfield also needs to be updated. The DB Synchroniseris a tool - provided by the add-on - allowing to do this automatically.
Find tables in the database that the table grid editor uses to store its data. Here is how.
go to Administration -> Add-ons -> TABLE GRID EDITOR -> Synchronizer
press Synchronize TGE data with JIRA button and wait until all issues are processed
The empty grid search feature (JQL: "Table Grid is EMPTY") still finds the grids, which have some rows
After importing the rows, the grids, which were empty before importing the rows are still found by the JQL search for EMPTY grids. After removing externally some of the rows, the grids, which became empty after this are not found by the JQL search for issues with еру grid EMPTY.
Background. How it works
The search for issues, which have their grid EMPTY is based on the customfield value. When an issue action (issue creation, issue editing, issue workflow transitioning) is being executed, the TGE customfield type stores a new customfield value, based on the number of rows. If the number of rows in the grid is changed externally, the only way for TGE to set the new adequate customfield value would be submitting an issue action.
The imported rows get deleted after editing an imported issue
After importing an issue, one inserts a row into the grid table via SQL. Then one goes to the affected issue. One can not see the grid on the view issue screen (the reasons are described in this page). One goes to the edit screen. There, the grid in the edit mode shows the inserted row. One submits the editing. the grid is shown on the view issue screen, but no rows are present.
Background. How it works
The fact, that the customfield value for the newly imported issue is NULL, for the TGE means, that when one submits an issue action, TGE is removing all the rows from the grid table, which are connected to this issueId (in other words, when TGE sees, that there is no value for this issue for this customfield, it thinks, that any data in the grid table for this grid is stale data, and thus removes the data).