...
- 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 : 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.
- Calculated Date/Time Field : 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.
Included JQL function:
- Home (new in 1.1): a JQL function that returns the value of a property of the current user, transforming comma-separated values into a list of values.
...
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 | ||
---|---|---|
| ||
|
...
Code Block |
---|
<!-- @@Format: if (value > 21) return "<img src='/images/icons/priority_trivial.gif'> "+numberTool.format(value); else if (value >= 10) return "<img src='/images/icons/priority_major.gif'> "+numberTool.format(value); else return "<img src='/images/icons/priority_blocker.gif'> "+numberTool.format(value); --> |
Anchor | ||||
---|---|---|---|---|
|
- Create a new custom field, choosing "Calculated Text Field" for its type.
- During step 2, in the Description field, include the calculation formula using the syntax described below.
- 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 the first 10 characters of the issue's summary field.
<!-- @@Formula: issue.get("summary").substring(0,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 .substring(0,10)
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 | ||
---|---|---|
| ||
|
Note that you must make sure the formula returns a String, or null.
Anchor | ||||
---|---|---|---|---|
|
- Create a new custom field, choosing "Calculated Date/Time Field" for its type.
- During step 2, in the Description field, include the calculation formula using the syntax described below.
- 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 | ||
---|---|---|
| ||
|
Note that you must make sure the formula returns a java.util.Date, or null.
Anchor | ||||
---|---|---|---|---|
|
...
Code Block |
---|
resolution = Unresolved AND project in currentUserPropertyAsList("myProjects") |