Versions Compared

Key

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

You can set up your grid to update together with the list item that you select.

...

This example use a grid with products, product prices, and total price. The price and total prices will update after we select a specific product in a grid.

...

Style
code {
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 5px;
    font-weight: bold;
    padding: 3px 3px;
}

dt {
    font-weight: bold;
    margin-bottom: 2px;
    margin-top: 2px;
}

In this section

Table of Contents
indent30px
exclude(In this section|See also)
stylenone

Example

...

Introduction

This example use a grid with products, product prices, and total price. The price and total prices will update after we select a specific product in a grid. By practicing this use case, user can use Jira project for sale management where they can continuously update new order/bill in ticket.

Prerequisites

  • User logged into their account, installed Table Grid Next Generation Server / Datacenter

  • User created a related Jira project

  • User had the admin role on Jira 

Post-condition

  • User can use the grid to update related information for the list of items.

  • User can download/upload the Configuration for personal usage

  • User can use the calculation on the Table Grids in Issues/Tasks.

...

To make such a grid, we need to do the following:

...

  •  

Conditions

  • Required fields are marked with a red asterisk *

  • The grid must contain at least one column

  • The grid can be displayed in more than one project

  • User can download/upload the config for future usage in other project/issues.

  • When adding new columns or save the configuration, user need to reindex JIRA in order to changes to take effect.

  • When clicking the box Cell value required, user need to fill the information in the cell.

Flow chart diagram


Creating configuration

Basic Flow

Step

Action

1

In Projects, click Create Project

Image Added

2

Fill all the related information about project.

In this example, writer use Test 3 for Name and T3 for Key

Image Added


3

Navigate to Jira Administration by clicking button Image Added

4

Click Manage Apps, in Table Grid section choose Grids 

5

In Grid Fields, click Add Grid button to add new grid

6

Fill information for “Name” and “Description” 

In this example, writer used

  • Name = “Smartphone

  • Description = “Smartphone

Then in Scopes, fill all the necessary information includes Projects and Issue Types.


Image Added

7

In Configuration - Column, click Add new column to create new column

8

In Add Column, choose Single select list in Column type

9

User fill information for Identifier and Title

Type “jproduct“ as Identifier and type “Product” as Title

Image Added

In Static options, fill all the related information.

Click the “+” button on the “Option attributes” to add options for the “Product” column. The column will have these option attributes:

...

  • “Label”: default attribute, that will show the names of

...

  • products.

...

  • “Price”: that will store info about the price of

...

  • products.

...

  • “Currency”: which will store info about

...

  • product currency.

Image Added

In this example.

...

Image Removed

Tip

Check the following articles for more information:

Lists in a grid

Adding option attributes to a list

...

Now, let's create three formula columns:

  • Price — the price of our product.
  • Total price — the total price of our products.
  • Currency — the currency of our order.
Tip

For more information, check out Formulas in a grid.

Each column will have a different formula:

...

writer used price and currency for each label like this

Image Added

10

Click Add to save the information 

11

Click Add new column to create new column

12

In Add Column, choose Single select list in Column type

13

User fill information for Identifier and Title

Type “jamount“ as Identifier and type “Amount” as Title

Image Added

14

Click Add to save the information 

15

In Add Column, choose Single Select List in Column type

16

User fill information for Identifier and Title

Type “jprice“ as Identifier and type “Price” as Title

The “Pricecolumn will reuse the data from the priceoption attribute from the Productcolumn. To do so, we will input the following formula:

...

languagejs
themeFadeToGrey
return

...

$(product).price
Image Added


17

Click Add to save the column information 

18

Formula parameters:

product — The Identifier of the Product column.

In Add Column, choose Formula in Column type

Type “Total price” as Identifier and Type the “Total price” as column Title

Image Added

The “Total pricecolumn will multiply the data from the price option attribute by the data from the Amountcolumn. To do this, we will use the formula:

...

return

...

$(price)

...

*

...

$(amount)

price — Identifier of the Price column.

Image Added

The “Currencycolumn will display the data from the currency option attribute from the Productcolumn. We will use the following formula to do this:

...

...

return

...

Result

The following result should look like this:

Image Removed

See also

Lists in a grid

Adding option attributes to a list

...

$(product).currency

19

Click Add to save the information 

20

Formula parameters:

productIdentifier of the Product column.

price — Key of the Price option attribute.

In Add Column, choose Formula in Column type

Type “jcurrency” as Identifier and Type the “Currency” as column Title

Image Added

21

User click Save button to save the columns information

22

Based on your individual purpose, you can fill information for each column by double click the cell.

Click Save button to save the config.

Image Added


Exceptional Flow

Users type wrong calculation

Continued from step #16 in the Basic Flow:

Step

Description

17

If the user enters the wrong calculation, the system will show one of the following: 

  • #error - syntax error

  • #type - operation error (operation could not be executed using different column types)

Use case stops.


Users click “Cancel” at “Edit Column” 

Continued from step #8 in the Basic Flow:

Step

Description

9

  • The system shows the main page of “Grid Fields” 

Use case stops.


Users don’t click “Save” at “Configuration” 

Continued from step #20 in the Basic Flow:

Step

Description

21

  • The system shows the main page of “Grid Fields”  

Use case stops.

Grid configuration file

To go faster you can import this grid configuration = Smartphone.json

Apply the grid on Issue Screen

In Project Test 3, click Create Issue → Click Create to proceed next step

Image Added

Click on the Table Grid icon on the issue screen, and you will see your grid on issue

User can continue to edit the config in the issue by clicking the Image Added button and add more rows in the issue by clicking the Image Added button

Click Image Added to save any changes or click Image Added to cancel it.