Versions Compared

Key

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


Page properties
hiddentrue
Tech review

Status
titletodo

Style guide

Status
titletodo

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged

UI Text Box
sizemedium
typeinfo

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 returned by field codes.

UI Text Box
typetip

 

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

Learn more about working with Texts.


Image AddedConfiguration

Configuring a calculated text field is straightforward. You just have to configure a valid parsing mode and add a parser expression, which will "calculate" the output.

UI Steps


UI Step

Create a new Calculated Text Field (by JWT) custom field and name it properly

Configuration

Parsing Modes

Info
iconfalse

There two 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 run-time with the corresponding field values in current issue.
Advanced: with this parsing mode we can do much more complex text composition thanks to the usage of functions for replacing substrings, changing case, reading fields in linked issues, sub-tasks, JQL selected issues, and much more. It requires the text to be parsed to be written as string expression respecting strictly the parser syntax.

UI Text Box
typetip

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.

Providing a description will help you to identify what the custom field does but this step is optional



UI Step

Parsing mode

Make sure to select the correct parsing mode for your expression. Learn more about Parsing modes.

Basic text modeAdvanced text mode


Code Block
languagebash
titleExpression
linenumberstrue
This issue was last updated on %{issue.lastStatusChange}.



Code Block
languagebash
titleExpression
linenumberstrue
"This issue was last updated on" + %{issue.lastStatusChange} + "."



UI Text Box
typetip

The parsing mode will define the syntax of your expression. Using parser functions will only work in advanced mode.



UI Step

Text expression

Add a valid parser expression which will "calculate" the output.

Usually field codes will be used for this purpose.

Code Block
languagebash
titleExpression
linenumberstrue
%{issue.lastComment} # This example simply returns the last comment of an issue. 





Image AddedUse cases and examples

Page properties report
headingsField type, JWT feature, Parser functions, Label
sortByTitle
cqllabel = "calculated-field" and space = currentSpace() and ancestor = currentContent()

Text to be parsed

Info
iconfalse

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

Example: Calculated Text Field "Components of Sub-tasks"

Info
iconfalse

In this step by step 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 the current issue's sub-tasks.

UI Steps UI Step

Create a new Calculated Text Field custom field called "Components of Sub-tasks"

Head over to Administration → Issues

Image Removed

→ Custom fields → Add custom Field → Advanced → Calculated Text Field (by JWT)

Image Removed

UI Step

On the configuration screen of the newly created custom field go to Actions and click on Configure

Image Removed

UI Step

Click on Edit Text Expression

Image Removed

UI Step

Configure the field by selecting the Advanced parsing mode and then enter a text to be parsed. After the configuration, click on save

Image Removed

UI Text Box
typeinfo

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

To achieve this, the following functions are used:

UI Step

Finally, the configuration of the new custom field should look like this:

Image Removed


Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue