Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

Be aware that the syntax of the field has been recently modified.

Since the we are using Jira Expressions for the formula. Find details on this page below.

On this page


Field configuration

Before starting the field configuration, please follow the instructions for creating custom fields

Create a Custom Field

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.

image-20240129-122910.png

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.

image-20240221-105826.png

There’s an autocomplete to add field placeholders. Just write “issue.“ and see recommended number fields.

image-20240221-110426.png

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 field allows you to choose from a pre-defined set of field sizes.

You may also set different colors for different values.

image-20240129-123346.png

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.

image-20240221-110831.png

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.

You may resolve this by providing a default value by using boolean operators like this (issue.customfield_10060 || 17).

image-20240221-111230.png

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.

image-20240129-125846.png

Preview

image-20240129-125612.png


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: https://help-seibertmedia.atlassian.net/wiki/spaces/ACF/pages/edit-v2/77037570#Data-Structure-(Automation).

image-20240221-113537.png


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>

image-20240221-112435.png


Related Use Cases

More use cases are coming soon. In the meantime, check out our other use cases.


Jira Service Management (JSM)

Please note that this field is interdependent, relying on other field values or subtasks. It is essential to populate or update the field initially through loading the issue view of the request, typically performed by an agent. Failure to do so will result in these fields remaining empty and consequently not displayed on the request view.

Before you can add a custom field for Jira Service Management (JSM) projects, you first need to setup the custom field

https://help-seibertmedia.atlassian.net/wiki/spaces/ACF/pages/edit-v2/77037570#Field-configuration

Then follow this guide to use the field in the request form or the portal view

Add Custom Fields to Jira Service Management


JQL expression

The value is calculated just in time and saved as a field value, but there may be a delay in updating when a placeholder field value changes.

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)

As the value is calculated, we don’t recommend to edit it manually or by automation!

To set the value via automation, you need the following object structure

{
  "value": number
}
  • No labels