Clone wiki

JIRA Workflow Toolbox / custom-fields / Calculated Text Field

Calculated Text Field

This type of read-only custom field has a value which is dynamically calculated from a custom text expression. It can be used to show a text composed from one or more field values.

You can also create any custom text value depending on the values of other fields in current issue, linked issues, sub-tasks, epics, stories, or any other issue in your JIRA instance selected by a JQL query.

Configuration

Parsing Modes

There 2 parsing modes available:

  • Basic: with this simple parsing mode you can write free text and insert field codes with format %{nnnnn} or %{nnnnn.i} anywhere in your text. These field codes will be replaced at runtime with the corresponding field values in current issue.
  • Advanced: with this parsing mode we can do much more complex text composition thanks for the usage of functions for replacing sustrings, changing case, reading fields in linked issues, subtasks, JQL selected issues, and much more. It requires the text to be parsed to be written as string expression respecting strictly the parser's syntax.

    Automatic parsing mode converter: You can write your text in basic mode, and then switch to advanced mode. The text to be parsed will be automatically rewritten as a string expression. Now, you can simply make the modifications you require, making use of text formatting functions, or inserting math or time expressions where needed.

Text to Be Parsed

This parameter contains the text expression that will be parsed in the selected parsing mode.

Example: Calculated Text Field "Components of Subtasks"

In this example we show how to create a calculated text field called "Components of Subtasks" that will contain a comma separated list with the components of current issue's subtasks.

1) Create a new Calculated Text Field custom field called "Components of Subtasks" at Administration > Issues > Custom fields > Add Custom Field > Advanced > Calculated Text Field (by JWT)

2) Go to configuration screen of the newly created custom field:

./custom-fields/calculated-text/ex1-conf-1.png

3) Click on 'Edit Text Expression':


./custom-fields/calculated-text/ex1-conf-2.png

4) Configure the field by selecting a parsing mode, and by entering a text to be parsed:

./custom-fields/calculated-text/ex1-conf-3.png

5) Once configured, the configuration of the new custom field looks like this:

./custom-fields/calculated-text/ex1-conf-4.png



The text expression used in this example is: toString(distinct(fieldValue(%{00094}, subtasks()))), where %{00094} is field code for Components.

Updated