Versions Compared

Key

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

...

Overview

The JIRA Misc Custom Fields space.

To help you on your way, we've inserted some of our favourite macros on this home page. As you start creating pages, adding news items and commenting you'll see the macros below fill up with all the activity in your space.

...

Column
width60%
Recent updates

...

width5%

...

width35%

...

Navigate space

...

Page Tree Search

...

plugin's objective is to provide several new types of custom fields for use in custom JIRA workflows (although at this time it only provides one).

Included custom field:

  • 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.

Installation

The plugin is a "type TWO" plugin, which means that the plugin can be installed by copying it to jira-home/plugins/installed-plugins or, better yet, using the excellent Atlassian Universal Plugin Manager.

Usage

Calculated Number Field

  1. Create a new custom field, choosing "Calculated Number 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:

Panel
Span
stylefont-family:Courier

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

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

Panel

This field represents the number of Affected Versions.
<!-- @@Formula: issue.get("versions").size() -->

The formula itself is a Java-style expression that can reference any issue field value, include arithmetic operators as well as any other Java operator, and Java method calls (such as the .size() example above). Access to issue field values is achieved by the following syntax:

Panel
Span
stylefont-family:Courier

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).

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 number, or null.

Examples

...

Adding two fields

...

To add two custom fields, such as "Business Value" and "Technical Value" to get an "Overall Value":

Code Block
<!-- @@Formula: (issue.get("customfield_10114") != null ? issue.get("customfield_10114") : 0) + (issue.get("customfield_10150") != null ? issue.get("customfield_10150") : 0) -->