The value of this read-only custom field is calculated automatically using a custom math or numeric expression.
You can use it to generate a number based on the values of other fields in the current work item or in related work items (such as linked issues, sub-tasks, epics, stories, or issues returned by a JQL query).
Create a custom number formula field
Choose the template
Just like for any other formula field, follow the steps outlined here: Create and configure formula fields and select the Custom number formula field template in the field creation assistant.
Once selected click on Next.
Provide the expression
Creating an expression from scratch might feel like a challenge, especially if you are not familiar with our expression editor (known from our app Jira Workflow Toolbox). But we have you covered!
Either start by looking at the built-in example expressions or browse through the use cases and examples we have collected for you at the bottom of this page.
Preview the output
Once you have provided the expression you can preview and validate the output by selecting an existing work item.
Number format pattern
If your formula field is being used to store a simple number (e.g. a dollar amount), you have the option to display the value just like you would expect it - by applying a custom Display formats.
You can even use emojis like 💵 💶 ⭐️ when selecting a custom format!
📚 Use cases and examples
| Use case | Parsing mode | Expression |
|---|---|---|
| Average time since creation of sub-tasks |
General |
%{floor(avg(toNumberList(jiraExpression("issue.subtasks.map(i=>(Number(new Date())-
Number(i.created)))"))))}
|
| Completion percentage by status |
General |
%{%{issue.status} = "Open" ? 0 :
( %{issue.status} = "Planning" ? 15 :
( %{issue.status} = "In Progress" ? 60 :
( %{issue.status} = "In Review" ? 70 :
( %{issue.status} = "Implementing" ? 85 : 100 ))))}
|
| Count frequency of a keyword in social media content |
General |
%{count(findPattern(%{issue.cfnnnnn}, %{issue.cfmmmmm}))}
|
| Days until due date |
General |
%{{issue.dueDate} != null ? floor(max({issue.dueDate} -
datePart({system.currentDateTime}, RUN_AS_LOCAL), 0) /
DAY) : null
|
| Difference between the current day and the earliest sub-task due date |
General |
%{max(fieldValue({issue.dueDate},subtasks())) != null ? ceil((
min(filterByValue(fieldValue({issue.dueDate},subtasks()),!=,
null )) - {system.currentDateTime}) / DAY) : null}
|
| Elapsed time between creation and resolution |
General |
%{{issue.resolutionDate} != null ? (({issue.resolutionDate} - {issue.created}))
: null}
|
| Highest value out of several fields |
General |
%{max([{issue.cfAAAAA}, {issue.cfBBBBB}, {issue.cfCCCCC},
{issue.cfDDDDD}, {issue.cfEEEEE}])}
|
| Multiply and sum field values from sub-tasks |
Jira expression |
issue.subtasks.length && issue.subtasks.map( s => (s.customfield_nnnnn || 0) * (s.customfield_ppppp || 0)) .reduce((a, b) => a + b) |
| Number of characters in a field |
General |
%{count(findPattern(%{issue.cfnnnn}, "."))}
|
| Number of sub-tasks based on status |
General |
%{count(filterByStatus(subtasks(), "Done, Completed"))}
|
| Number of sub-tasks based on status and work item type |
General |
%{count(filterByIssueType(filterByStatus(subtasks(), "Done,
Completed"), "Sub-task, Sub-story"))}
|
| Number of times that a custom field has been changed |
Jira expression |
issue.changelogs .filter(changelog => changelog.items .some(item => item.fieldId == 'customfield_nnnnn')) .length |
| Number of work items with the same fix versions |
General |
%{%{issue.fixVersions} != null ? count(issuesFromJQL(
"fixVersion in ('" + jiraExpression( "issue?.fixVersions?.map(
v => v?.name).join(\"','\") ") + "') ")) : null}
|
| Priority assessment based on field values |
General |
%{sum([%{issue.cfnnnnn} = "Option 1" ? 1 : 0, %{issue.cfppppp}
= "Option 2" ? 1 : 0 ])}
|
| Remaining budget - expenses tracked in sub-tasks |
General |
%{{issue.cfnnnnn} = null ? null : {issue.cfnnnnn} - sum(
append(fieldValue({issue.cfppppp}, subtasks()), [0]))}
|
| Sum completed sibling items’ story points |
General |
%{sum(fieldValue({issue.cfnnnnn},issuesFromJQL("statusCategory = Done AND 'parent' = "+%{parent.key})))}
|
| Sum of field values from sub-tasks |
General |
%{sum(fieldValue({issue.cfnnnn}, subtasks()))}
|
| Sum of field values from work items in JQL query |
General |
%{sum(fieldValue({issue.cfnnnnn},issuesFromJQL("project = DEMO
and 'fieldName' is not empty")))}
|
| Sum of time spent on blocking work items |
General |
%{sum(append(fieldValue({issue.timeSpent},linkedIssues("is
blocked by")), [0]))/60}
|
| Sum of time spent on epic and child work items |
General |
%{%{issue.issueType} = "Epic" ? (sum(append(fieldValue(
{issue.timeSpent}, issuesUnderEpic()), [{issue.timeSpent}] ))
/ 60) : null}
|
| Sum of time spent on work items with same fix version |
General |
%{%{issue.fixVersions} != null ?
sum(append(fieldValue({issue.timeSpent},
issuesFromJQL("fixVersion = '"+%{issue.fixVersions.id}+"'")),[0]))/60)
: null}
|
| Time left until due date |
General |
%{{issue.dueDate} != null ? max({issue.dueDate} -
{system.currentDateTime}, 0) / DAY : null}
|
| Time since creation |
General |
%{{system.currentDateTime} - {issue.created}}
|
| Total original estimate of blocking work items |
General |
%{sum(append(fieldValue({issue.originalEstimate},linkedIssues(
"is blocked by")),[0]))/60}
|
| Total remaining estimate of blocking work items |
General |
%{sum(append(fieldValue({issue.remainingEstimate},linkedIssues(
"is blocked by")),[0]))/60}
|