tbngAddRows

Syntax

tbngAddRows(tableGridNGFieldName, json)

Description

This routine adds rows to a Table Grid Next Generation custom field.

Parameters

Parameter name

Type

Required

Description

Parameter name

Type

Required

Description

issue key

string

No

The key of the issue which will be changed

tableGridNGFieldName

string

Yes

the name of a Table Grid Next Generation custom field. The name can be represented as:

  • the name

  • the id (customfield_NNNNN)

  • the alias

json

string



Json representation of the data of a Table Grid Next Generation custom field

Return type

string[] - an array of the rows ids of the added rows.

Examples

For all examples we use the default configuration of the custom field:

 

Basic example:

string json = "[{\"jsummary\":\"Mike Brook\",\"jassignee\":{\"key\":\"admin\"},\"jstatus\":\"Open\"},{\"jsummary\":\"Paul\",\"jassignee\":{\"key\":\"admin\"},\"jstatus\":\"In Progress\"}]"; string[] addedRows = tbngAddRows("TEST-1", "My Grid Field", json);

In this example we use a struct to construct a json string with the Table Grid Next Generation custom field data:

struct TbGridAssignee {     string key; }   struct MyGridFieldRow {     string jsummary;     TbGridAssignee jassignee;     string jstatus;     string jseq; }   MyGridFieldRow[] myGridFieldRows = {};     TbGridAssignee tbGridAssignee; tbGridAssignee.key = "admin";     MyGridFieldRow myGridFieldRow;   myGridFieldRow.jsummary = "Mike Brook"; myGridFieldRow.jassignee = tbGridAssignee; myGridFieldRow.jstatus = "Open"; myGridFieldRows[0] = myGridFieldRow;     myGridFieldRow.jsummary = "Paul"; myGridFieldRow.jstatus = "In Progress"; myGridFieldRows[1] = myGridFieldRow;     string[] addedRows = tbngAddRows(key, "My Grid Field", toJson(myGridFieldRows));