Date: Thu, 28 Mar 2024 11:49:18 +0100 (CET) Message-ID: <302712742.316.1711622958339@apps-confluence-5.apps-confluence.apps.svc.cluster.local> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_315_1062529857.1711622958338" ------=_Part_315_1062529857.1711622958338 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This type of read-only custom field has a val= ue which is dynamically calculated from a custom math/numeric expression. I= t can be used to obtain a numeric value depending on the value of other fie= lds in current issue, or in any other issues: linked issues, sub-tasks, epi= cs, stories, JQL selected issues, etc.
For stability reasons, self-referencing of the field to be configured is= not allowed in basic mode. In all other modes, we do not recommend using t= he field code, except in special cases
This parameter contains a valid math expression that will be calculated each time t= he value of the field is required.
In this example we show how to create a calculated number field called "= Number of Blocking Issues" that will return the number of = unresolved issues current issue is linked to with "is blocked by" issue link type.
1) Create a new Calculated Number Field custom field called "Num=
ber of Blocking Issues" at Administration > Issue=
s > Custom fields > Add Custom Field > Advanced > Calculated Nu=
mber Field (by JWT)
2) Go to configuration screen of the newly created custom field:
3) Click on 'Edit Math/Numeric Expression':
4) Configure the field by entering a math/numeric expression:
5) Once configured, the configuration of the new custom field looks like= this:
The math expression used in this example is: count(fi=
lterByResolution(linkedIssues("is blocked by"), ""))
.
In this example we configure a calculated number field that will show th= e remaining time for Due Date:
We use the following math-time expression: {00012} !=3D nu=
ll ? max({00012} - {00057}, 0) : null
, where {00012=
} is code for Due date, and {00057}=
is code for Current date and time.
Notes:
? :
in order to avoid errors in the s=
ubtraction when Due date is not set. In this case we retur=
n null
, i.e., not initialized.max(x, y)
is used to avoid returning a negative d=
uration when Due date has passed.We select duration as display format, since the numeric=
value being calculated, a number of milliseconds, represents a time durati=
on. This way the value is represented like Time to Due Date=
strong>: 2d 9h 43m
instead of a single number.
We also check parameter "Uninitialized when calculated value is = zero", since we don't want the field to be shown once Due Date has= been reached.
In this example we configure a calculated number field for showing the t= ime elapsed since issue creation to issue resolution. For issues which are = still not resolved, the field will be uninitialized, thus it won't be shown= in the view screen:
We use the following math-time expression: {00112} !=3D null=
? {00112} - {00009} : null
, where {00112} is code for Date and time of resolution, and {00=
009} is code for Date and time of creation.
Notes:
? :
in order to avoid errors in the s=
ubtraction when Date and time of resolution is not set. In=
this case we return null
, i.e., not initiali=
zed.We select "Duration with short format" as display mode.=
This way, the string value of the field will be something easily readable,=
like 1d 11h 30m
, but the numerical value wil=
l be the duration expressed in milliseconds.
Other display options available are:
1 day, 11 hours, 30 minutes
.