Page tree
Skip to end of metadata
Go to start of metadata

This guide shows how to use formulas in the #Grid Custom Field# . 

Formula is a separate column type based on JavaScript. The grid can process formula logic.

To use a formula in a gird, add a separate column using formula column type, input formula inside embedded JavaScript Ace Editor and get results on the grid.

You can execute different operations using formulas in the gird. Use JavaScript to create formula expression. All details about formula functionality are available in the documentation.

Let's create the formula column:

Prerequisites: configured gird and columns. You need columns to create formula expression. 

  1. Add a new column to the grid, using formula column type 
     


  2. Input column's details:

    Column type - select Formula type.
    Identifier - a unique variable to identify the column. Required field - you can set the desired value here.
    Title - 
    column title, displayed in the grid. 
    Column IDs - 
    list of existing columns' IDs. Use in order to create a formula.
    Formula expression - embedded JavaScript editor, where you need to input your formula. Uses Ace Editor, which highlights the syntax. 
    Summary Label - label name, that will be used in the column summary.
    Aggregation operation -  select aggregation operation of the column data: sum, average, min/max, and count.
     
  3. Input the formula, based on the grid columns' IDs.

    Attention

    Use column IDs in the formula expression.

     

    Formula code example
    if($(calculate)){
        return $(salary) + $(bonus)
    } else {
        return $(salary)
    }
  4. Save changes.

Congratulations! You just created your first formula. Now you can use formulas in the Table Grid Editor for JIRA Cloud.

 

Check more examples on the formula configuration page.

  • No labels