Advanced Formula
On this page
Field configuration
Before starting the field configuration, please follow the instructions for creating custom fields
Step 1: Set a name and description
Provide a good name for the new custom field. Make it descriptive, concise, and easy to understand for others who will use it. Avoid using ambiguous or overly technical terms.
Step 2: Add formula
To derive a numerical result from a formula, you can employ Jira Expressions for calculation.
For instance, the formula (issue.customfield_10060 + 5) * 2
will be computed with the issues' field value of customfield_10060
(e.g. 8) to yield (8 + 5) * 2 = 26
.
The outcome of the calculation must be a numerical value. Any other results will result in a validation error.
If you configured the field using the old syntax {{customfield_10060}}
, it undergoes on-the-fly migration. Simply saving the configuration again resolves this issue.
There’s an autocomplete to add field placeholders. Just write “issue.“ and see recommended number fields.
Step 3: Setup output format, size and color based on value
The decimal toggle lets you switch between integer and up to two decimal places.
The “Display format” can be set to image or text. When choosing image, additional configuration options will be available (Feature spotlight | Display as image or text ).
The size field allows you to choose from a pre-defined set of field sizes.
You may also set different colors for different values.
Find out more: Feature spotlight | Choosing Color based on Value
Field view and edit
No edit mode
Values are derived from other issues' field values, and users cannot modify the calculation settings.
However, users can observe the calculation process. In this instance, the customfield_10060
with the value 4 is inserted into the formula.
Formula validation
On the other hand, users receive hints in case of an error to understand what went wrong.
In this case, the value of customfield_10060
is unset (None), and therefore, it can't be used for a calculation.
Not available in create issue
As you cannot edit the value manually, you can’t set it when creating a new issue. Better make sure it’s not displayed in this screen.
Preview
Use nested field properties
There are custom fields of type 'object' that contain nested numerical properties you may wish to leverage. For instance, by utilizing the value of another Advanced Formula field. The data structure is outlined below: Advanced Formula | Data Structure (Automation).
Find out the custom field key (Advanced Formula | How to find custom field key )
Add the nested property (
.value
in this case)Cast it explicitly to type number
Save it
How to find custom field key?
If you intend to utilize field values of a type other than a number, these fields will not appear in the autocomplete. However, you can manually add them by determining the custom field key. This can be accomplished as follows:
Go to: Settings > Issues > Custom Fields
Choose the desired custom field and click edit
You find the id in the URL
Now you can add the field in your formula like this:
issue.customfield_<id>
Related Use Cases
Jira Service Management (JSM)
JQL expression
The sum field is an object type with a property Formula Result
.
${fieldName}.Formula Result: number
Example: a search for all issues with a calculation result greater than 5
"Advanced Formula.Formula Result" > 5
Data Structure (Automation)
To set the value via automation, you need the following object structure
{
"value": number
}