Formulas

A formula column computes a value for each row from that row's fields and from the rows around it. Add one with Formula… in Add a column, and change it later with Edit formula… in its header menu.

On this page

The formula dialog

Field What it holds
Column name The name shown on the header, such as "Remaining points".
Formula The expression. The box suggests names, functions and options as you type, and problems show as you type, pointing to the character where they occur.
Fields for the names in the formula The Jira field each name reads. A name that matches a field's id or name is filled in for you: story_points finds Story Points. For other names, you pick the field from a list.
Show values as Automatic, Number, Percent (0 to 1 shown as %), Duration (seconds shown as 1d 2h), Date, Text, or Markup (*bold*, _italic_, -strike-, +underline+, {{monospace}}, {color:red}…{color}, [label|https://…] links, and \ or a new line for a line break).

The app checks the formula again when you save it, and refuses one that can't be parsed, calls an unknown function, or uses a name with no field.

Suggestions and parameter help

The formula box, in New formula column and Edit formula column, completes what you type. It suggests what can be written where you type:

The New formula column dialog with the suggestion list open under the Formula box, a field highlighted by its formula name, and its name in Jira on the line under the list
  • While you type a name: the dialog's fields by their formula names, such as story_point_estimate, with the field's name in Jira on the line under the list, the row's own names (summary, status, assignee and the others), the names a WITH defines before that point, the aggregations such as SUM{…} and the functions such as SUM(). Names that start with what you typed come first. A function goes in with its brackets and an aggregation with its braces, ready for you to fill.
  • After a dot, as in summary.lo: the functions, called on the value before the dot.
  • After #, as in SUM#lea: the aggregation's options. separator= is offered only for JOIN, p= for PERCENTILE and q= for QUARTILE.
  • Nothing inside text in quotes, comments, TQL{…} queries, or right after a number.

Under the list, a line describes the suggestion in focus: what a function does, what an option does, or which Jira field a name reads.

Typing opens the list, but a formula you paste doesn't. Ctrl+Space opens it anywhere. ↑ and ↓ move through it, Enter puts the suggestion in, Escape closes the list without closing the dialog, and Tab leaves the box. While the list is closed, Enter starts a new line.

While you write the arguments of a function, a note above the box shows its parameters, with the one you are writing in bold, and what the function does. For example, DAYS_BETWEEN(start, end) reads "Days from the first date to the second." Commas inside text, lists and calls within the call don't count. A chained call such as summary.left( starts at its second parameter, and IF and CASE follow their pairs. The descriptions follow your Jira language, while function and parameter names stay in English, as the language writes them.

Help from Rovo

On sites with Rovo, Ask Rovo under the Formula box opens Rovo chat on the TreeCraft hierarchy helper agent. With a formula in the box, it asks the agent to explain and check it, and to suggest a simpler version. With the box empty, it asks for a column with the name you gave, and you finish the sentence with what the column should show.

The agent writes formulas from the functions on this page and the fields you can see, and checks them with the same checker as this dialog before showing them. It doesn't change the dialog: copy its formula into the box, or let it save the column to your own library, then add it from + Column, under Library · yours. See Formulas and queries for what it can do.

The language

A formula is an expression, or several lines that end with return (see Formulas written as lines). Names and functions are not case sensitive.

story_points * 2
IF(status = "Done", 1, 0)
summary.lower().left(10)
  • Numbers, text in double or single quotes (with \ to escape), true and false, and lists in square brackets.
  • Arithmetic with + - * /, and comparisons with = != < <= > >=.
  • AND, OR and NOT.
  • Comments with // to the end of the line, or between /* and */.
  • Chained calls: summary.lower() is the same as lower(summary).
  • Parts of a value after a dot: status.category, a version's releasedate, as in MAX(fixversions.releasedate). On a list, the part of each value.
  • test ? a : b is the same as IF(test, a, b), and === and !== compare as = and != do.

Formulas written as lines

A formula can be written as lines, the way JavaScript reads, with variables, choices and functions of its own. This is our formula language, not JavaScript, so only what is listed here works.

let all = COUNT#leaves{1};
let done = COUNT#leaves{IF(status_category = "Done", 1)};
if (all = 0) return undefined;
const share = done / all;
return share >= 0.8 ? "{color:green}On track{color}" : "{color:#b65c02}Behind{color}";
The formula dialog with a formula written as lines: two variables, an if line and a return, shown as Markup
Line What it does
let a = value;, const a = value; or var a = value; A variable, from the next line to the end of its block.
a = value; A new value for a variable declared before. A const can't take one.
function half(x) { return x / 2; } or let half = (x) => x / 2; A function of your own, from its line on.
if (test) { … } else if (test) { … } else { … } Runs one block. A block of one line needs no braces: if (done) return 0;.
return value; Ends the formula, or a function, with the value.
  • A line ends at ; or where the next line starts.
  • A variable declared inside braces is gone after them.
  • map, filter, sort_by and reduce take arrow functions, as in map(list, x => x * 2) or reduce(list, 0, (acc, x) => acc + x).
  • Inside an aggregation's braces, such as SUM{…}, fields are read on each row below, but a variable keeps the value it has on the row the formula is worked out for.
  • The dialog refuses a formula that never returns a value ("end it with return"), a line after return in the same block, and a value alone on a line that isn't the last.
  • let, return, if and the other words count as keywords only where a line starts with them, so a field named "Return" is still read.

Suggestions offer your variables and functions, and the words that start a line once you type one. Formulas written as one value, and WITH, keep working as before.

Local names and functions

WITH gives a value a name for the rest of the formula, and can define a function of your own:

WITH rest = timeestimate : IF(rest > 0, timespent / (timespent + rest), undefined)
WITH half(x) = x / 2 : half(SUM{story_points})

Missing values and errors

A missing value makes arithmetic missing, so a sum with an empty field stays empty. Use IF_DEFINED or DEFAULT to supply a value. An error, such as a division by zero or a bad argument, passes through everything except IF_ERROR.

Names you can use

key and depth come from the row (the top level is depth 1). parent, subtasks and links name other work items, and a field after a dot reads it from them, as in parent.status or subtasks.duedate, when those work items are also in the hierarchy. These names read the work item's fields without any setup: summary, status, status_category (To Do, In Progress or Done), type or issuetype, assignee, reporter, priority, resolution, created, updated, duedate, resolutiondate, timespent, timeestimate, timeoriginalestimate, labels, components, fixversions and project. Time fields are in seconds. You bind any other name to a field in the dialog.

User fields hold users, which show and compare by name. Two users are the same person when their account ids match. me() is the person viewing the page.

A name bound to an Assets field reads the attributes of its objects after a dot, with the attribute's name in lower case and spaces as underscores. If laptops is bound to the Laptop field, laptops.cost gives the Cost of each laptop the work item holds, as a list, and laptops.serial_number gives their serial numbers. SUM(laptops.cost) adds them up. You get attributes only for the object types Assets lets you see.

Reading other rows

Aggregations read the values of other rows. Write the function, any options after #, and the expression in braces:

SUM{story_points}
SUM#leaves{story_points}
JOIN#separator=" / "{key}
PERCENTILE#p=0.9{story_points}
SUM#preceding{story_points} + story_points

The functions are SUM, AVG, MIN, MAX, COUNT, JOIN, MEDIAN, UMIN, UMAX, PERCENTILE and QUARTILE.

By default an aggregation reads every row below. These options change which rows it reads and how:

Option Effect
#subtree The row itself and every row below it.
#children Only the rows directly below.
#leaves Only the rows at the bottom of the sub-tree.
#ancestors The rows above it.
#preceding The row's earlier siblings, for running totals.
#level=2..3 Only rows at those levels. The top level is 1.
#depth=1..2 Only rows that many levels below the row. Its children are 1.
#distinct Each work item once, however many rows show it.
#separator="…" The separator for JOIN. The default is a comma.
#ordering=asc or desc Sorts the values first. JOIN lists them in that order.
#compact Leaves out empty text as well as missing values.
#strict The result is missing when any value is missing.
#p=0.9 Which percentile, from 0 to 1. The default is 0.5.
#q=1 Which quartile, from 0 to 4. The default is 2.

A total still waiting for work items below it is marked incomplete until they load.

Queries in formulas

TQL{leaves} is true when the row matches the tree query. Put the query between the braces as is.

COUNT{TQL{leaves}}

Formulas don't run JQL. Each JQL{…} searched Jira every time the hierarchy opened, while the fields it tests are already on the rows. A formula saved with JQL{…}, or with a tree query holding a jql condition, shows what to change, and the dialog offers Use the rewrite, the same test written with the work item's fields, such as status.category = "done". When a part of the query has no field test, write it another way, or use a match column.

Functions

Group Functions
Arithmetic abs ceiling floor round sign sqrt pow exp ln log log10 mod
Logic if case choose and or not if_defined if_error is_error default
Text concat left right mid substring len lower upper trim replace replace_at repeat search match split join index_of last_index_of string number
Lists array map filter reduce sort sort_by reverse unique flatten merge_arrays subarray first last size contains contains_any contains_all is_empty sequence
Statistics sum avg average min max umin umax median percentile quartile stdev stdevp count
Dates and times now today date datetime make_date make_datetime date_add date_subtract date_set datetime_add datetime_subtract days_between hours_between months_between years_between weekday weeknum day month year hour minute second start_of_month end_of_month truncate_time truncate_to_day truncate_to_hour truncate_to_minute truncate_to_week truncate_to_month truncate_to_year format_datetime parse_datetime
Working days workdays_between add_workdays is_workday
Durations duration format_duration calendar_seconds calendar_minutes calendar_hours calendar_days calendar_weeks jira_minutes jira_hours jira_days jira_weeks
Users me user_display_name user_email user_name user_is_active
Other url_encode url_decode historical_value hierarchy_icon_url

Notes on some of them:

  • map(list, $ * 2) and filter(list, $ > 3) use $ for each item. reduce(list, 0, $acc + $) also has $acc, the value so far. sort_by(labels, len($), "desc") sorts by a key worked out for each item, and keeps the order of equal items.
  • sequence(1, 10) makes a list of numbers, with an optional step. The list can hold up to 10,000 numbers.
  • historical_value(status, "2026-10-01") is the value a field had at a moment, read from the work item's history. If the field hasn't changed since, you get the current value. For a moment before the work item existed, you get an empty value.
  • hierarchy_icon_url("issuetype") gives the address of the row's work type icon. "priority" and "assignee" give the priority icon and the assignee's picture.
  • user_email returns an address only when Jira shows it to you. user_name is the account id, since Jira Cloud has no user names.
  • The working-day functions and the jira_ durations follow the site's working calendar: days off are skipped, and a day or a week is as long as the calendar says (8 hours and 5 days unless an admin changed it). The calendar_ durations use clock time.

Examples

Goal Formula
Remaining story points below a row SUM{IF(status_category != "Done", story_points, 0)}
Share of leaves that are done COUNT#leaves{IF(status_category = "Done", 1, undefined)} / COUNT#leaves{1}
Days until the due date days_between(today(), duedate)
Keys of the children JOIN#children#separator=", "{key}
Running total of estimates SUM#preceding{timeoriginalestimate} + timeoriginalestimate

Example: flag late work and work that is due soon. You want one column that tells you where to look. Say today is 3 November 2026.

  1. Select + Column and pick Formula…. Name the column "Due flag".
  2. Type this formula, and set Show values as to Text: IF(status_category = "Done", "Done", IF(duedate = undefined, "No date", IF(duedate < today(), "Late", IF(days_between(today(), duedate) <= 7, "Due soon", "On track"))))

You see "Done" on finished work. Open work due on 30 October shows "Late", work due on 6 November shows "Due soon", work due on 20 December shows "On track", and work with no due date shows "No date".


Example: say how many stories are done. PLAN-1 has three stories, and one of them is done.

  1. Add a formula column named "Stories done" and set Show values as to Text.
  2. Type this formula: IF(COUNT#children{1} = 0, undefined, concat(COUNT#children{IF(status_category = "Done", 1, undefined)}, " of ", COUNT#children{1}, " stories done"))

You see "1 of 3 stories done" on PLAN-1. Rows with no children stay empty.


Example: time left on an epic. The three stories of PLAN-1 have 0 hours, 4 hours and 8 hours left.

  1. Add a formula column named "Time left" and type SUM{timeestimate}.
  2. Set Show values as to Duration.

You see "1d 4h" on PLAN-1, with a working day of 8 hours. A different working calendar changes the length of a day.

Performance

Your browser works out formulas over the rows of the view, using the work item data the grid already has. With 2,000 rows or more, the work runs in the background so scrolling and typing stay quick. A very heavy formula stops with an error value instead of freezing the page.

In exports, formula values keep their kind: numbers, percentages, durations and dates stay numbers and dates in a spreadsheet.

Questions about the app? Ask us in Plugincraft Support, our help center, or write to info@plugincraft.ca.