Versions Compared

Key

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

...

  • Calculated Number Field : a calculated custom field returning a number (integer or float). It is a read-only field that returns the result of the evaluation of a formula, such as the addition of two other fields.
  • Calculated Text Field (new in 1.5.5): a calculated custom field returning a String. It is a read-only field that returns the result of the evaluation of a formula, such as the concatenation of two other fields.
    • Exact Text Searcher (Statistics-compatible) (new in 1.5.6): a custom searcher that allows calculated text fields to be used in statistics gadgets
  • Calculated Date/Time Field (new in 1.5.5): a calculated custom field returning a java.util.Date (which represents a date+time). It is a read-only field that returns the result of the evaluation of a formula.
  • Transition Date/Time Field (new in 1.2): a calculated custom field returning the date and time of the last execution of a specified workflow transition.
  • Transition Caller Field (new in 1.2): a calculated custom field returning the caller of the last execution of a specified workflow transition.
  • Parent Status Field (new in 1.2.2): a calculated custom field returning the Status of the issue's parent issue.

...

Note that you must make sure the formula returns a String, or null.

Exact Text Searcher (Statistics-compatible) (new in 1.5.6)

When creating a Calculated Text Field, you can choose between the standard Free Text Searcher and the new Exact Text Searcher (Statistics-compatible). The latter should be used if you need either of the following:

  • Be able to search issues based on the exact value of the custom field (i.e. use the "=" operator instead of the "~" operator)
  • Be able to use the field in one of the statistics reports or dashboard gadgets

 

Anchor
calculateddatefield
calculateddatefield
Calculated Date/Time Field (new in 1.5.5)

  1. Create a new custom field, choosing "Calculated Date/Time Field" for its type.
  2. During step 2, in the Description field, include the calculation formula using the syntax described below.
  3. Re-index your data, as JIRA will kindly suggest you to.
Formula syntax

The formula should be included in the field description inside an html comment (so that it remains invisible when showing the field description), preceded by the following keyword: @@Formula: (note the colon at the end). For example:

Code Block
<!-- @@Formula: formula goes here -->

You can naturally include the real description of the custom field as well. For example:

Code Block
This field represents 10 days after the creation of the issue.
<!-- @@Formula: org.apache.commons.lang.time.DateUtils.addDays(issue.get("created"),10) -->

The formula itself is a Java-style expression that can reference any issue field value, include Java operators, and Java method calls (such as the org.apache.commons.lang.time.DateUtils.addDays() example above). Access to issue field values is achieved by the following syntax:

Code Block
issue.get("<field_ID>")

where <field_ID> is a built-in JIRA field ID (see this list) or a custom field ID (in the form customfield_nnnnn).

You can also access the JIRA Issue object using the issueObject variable.

Info
titleTo identify the custom field ID:
  1. go to Administration/Custom Fields
  2. click on the "Configure" link for the custom field you're interested in
  3. in the URL of the Configure Custom Field page, note the number after "customFieldId=" and append it to "customfield_" to build the custom field ID

Note that you must make sure the formula returns a java.util.Date, or null.

...