Versions Compared

Key

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


Excerpt

This page details out how to insert data into a grid table using database import.

Table Grid Editor for Jira Server stores data in a separate database. You can insert data into a grid using grid edit on the issue view on insert directly into the database. 

When adding a data source specification, you can select one of the supported databases.  Depending on this choice different parameters can be provided. 

In order to insert data directly into the database you should use sql query.

Prerequisites to insert data into the database

  • database name
  • TGE related issueId

Tips to get database name and TGE related issueId:

  • in Oracle and PostgreSQL use a hibernate_sequence to generate the ids for the row 
  • Database name rule : [nameOfTable]_c[customFieldIdfieldConfigId]
  • Ensure that the modified field is set to '0' indicating that the row was not modified yet

Note

We use the default TGE configuration

Code Block
gd.columns=isummary,iassignee,istatus,idue
gd.tablename=actions
gd.ds=jira



Examples of the queries

Code Block
languagesql
titleMySql
INSERT INTO
  actions_c10109(
    issueid,
    modified,
    isummary,
    iassignee,
    iassignee_name,
    istatus,
    istatus_name,
    idue
  )
VALUES(
    10000,
    0,
    'First summary',
    'keanu',
    'Keanu Reeves',
    'O',
    'Open',
    '2018-03-06'
  ),
  (
    10000,
    0,
    'Second summary',
    'keanu',
    'Keanu Reeves',
    'D',
    'Done',
    '2018-04-23'
  );

Image Modified

Code Block
languagesql
titlePostgreSQL
INSERT INTO
  "actions_c10315"(
    id,
    issueid,
    modified,
    isummary,
    iassignee,
    iassignee_name,
    istatus,
    istatus_name,
    idue
  )
VALUES(
    nextval('HIBERNATE_SEQUENCE'),
    10001,
    0,
    'First summary',
    'jhon',
    'Jhon Wick',
    'O',
    'Open',
    '2018-03-06'
  ),
  (
    nextval('HIBERNATE_SEQUENCE'),
    10001,
    0,
    'Second summary',
    'jhon',
    'Jhon Wick',
    'D',
    'Done',
    '2018-04-23'
  );

...