The value of this read-only custom field is dynamically calculated from a custom mathematic or numeric expression.
It can be used to obtain a numeric value depending on the value of other fields in the current issue or in any other issues (linked issues, sub-tasks, epics, stories, JQL selected issues, etc).
Configuration
Smart fields can be configured in two different ways. You can either use the Template view to choose from a set of preconfigured templates from our use case library, or you can switch to the Expert mode where calculations can be configured freely with our expression editor, best known from our Jira app Jira Workflow Toolbox (Cloud).
The Template view is the default configuration view of Smart Fields for Jira. It provides a set of preconfigured templates which are represented by cards. Each card shows a short name describing its purpose and the icon of the template category.
From here, you can switch to the Expert mode at any time. If you had selected a template, its configuration is taken over to the Expert mode, where you can alter the corresponding parser expression. Be aware that you cannot switch back to the Template view once you have made any changes in the mode, even if you reverse them.
Select a use case from Template
Select a use case by clicking on a template card in the overview, or by clicking on Select at the button of the card. The selected card will be highlighted.
You can also search for templates by name or drill down in the overview by selecting a specific category, only showing templates from this category.
Some templates require more setup, like picking the source fields for your calculation. Based on the template you choose for your situation, you might need to click Next in the bottom right corner.
For instance, if you want to calculate the "total story point of an issue within an epic", you will need to pick the field that contains your story points.
Click Save in the bottom right corner to finish your configuration.
The Expert mode allows you to configure custom Smart fields with the expression editor, best known from our best-rated Jira app Jira Workflow Toolbox (Cloud). You are free to edit the entire expression down to the logical elements.
Select "Expert mode"
From the Template view, click the Expert mode button in the top right corner.
Enter a valid Expression
Need some inspiration? We have prepared some really helpful use cases and expressions for you. Check them out here: Use case library
Want to learn more about Expressions? Check out these pages: Expression Parser & Jira Expressions
Select display format
Optionally, choose a custom display format. This is extremely useful to enhance usability for end users.
Read more about the available Display formats.
Click Save in the bottom right corner to finish your configuration.
Use cases and examples
Use case | Built-in | 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))/1000/60/60/24)"))))} | |
Completion percentage by status | General | %{%{issue.status} = "Open" ? 0 : ( %{issue.status} = "Planning" ? 0.15 : ( %{issue.status} = "In Progress" ? 0.6 : ( %{issue.status} = "In Review" ? 0.6 : ( %{issue.status} = "Implementing" ? 0.85 : 1 ))))} Please, replace the status names as well as the completion percentages with the ones of your choice. Any status not included in the sequence will return 1. | |
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}) / DAY ) : null} The duration can be retuned in years, weeks, days, hours or minutes if the DAY keyword is replaced in the above expression with the corresponding time constant. | |
Highest value out of several fields | General | %{max([{issue.cfAAAAA}, {issue.cfBBBBB}, {issue.cfCCCCC}, {issue.cfDDDDD}, {issue.cfEEEEE}])} Please, replace the field codes with the ones of your choice. | |
ICE score | Jira expression | (issue?.customfield_IIIII || 0) * (issue?.customfield_CCCCC || 0) * (issue?.customfield_EEEEE || 0) Replace the IDs with the ones of your number custom fields Impact (IIIII), Confidence (CCCCC) and Ease (EEEEE). | |
Months elapsed | General | %{{issue.cfnnnnn} != null ? ((year({system.currentDateTime}, RUN_AS_LOCAL) - year({issue.cfnnnnn}, RUN_AS_LOCAL))*12 + month({system.currentDateTime}, RUN_AS_LOCAL) - (month({issue.cfnnnnn}, RUN_AS_LOCAL))) : null} Please, replace both nnnnn in the above expression with the ID of your Date Picker custom field. | |
Number of affected versions | General | %{issue.versions.length} | |
Number of assignee changes | Jira expression | issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'assignee')).length | |
Number of attachment authors | Jira expression | issue.attachments.map(attachment => attachment.author.accountId).reduce((a, b) => a.includes(b) ? a : a.concat(b), []).length | |
Number of attachments | General | %{issue.attachments.length} | |
Number of attachments in sub-tasks | Jira expression | issue.subtasks.map(subtask => subtask.attachments.length).reduce((a, b) => a + b, 0) | |
Number of comment authors | Jira expression | issue.comments.map(comment => comment.author.displayName).reduce((a, b) => a.includes(b) ? a : a.concat(b), []).length | |
Number of comments | Jira expression | issue?.comments?.length | |
Number of components | Jira expression | issue.components.length | |
Number of days in previous status | Jira expression | let statusChangelogs = issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status')); statusChangelogs[0] ? (statusChangelogs[0].created.getTime() - (statusChangelogs[1] ? statusChangelogs[1].created : issue.created).getTime()) / (24*60*60*1000) : null | |
Number of fix versions | General | %{issue.fixVersions.length} | |
Number of incoming issue links | Jira expression | issue?.links?.filter(link => link.direction == "inward").length | |
Number of issues under epic | Jira expression | issue.stories?.length | |
Number of issues under epic including sub-tasks | General | %{%{issue.issueType} = "Epic" ? count(append(issuesUnderEpic(),subtasks(issuesUnderEpic()))) : null } | |
Number of issues with the same fix versions | General | %{%{issue.fixVersions} != null ? count(issuesFromJQL("fixVersion in ('" + jiraExpression( "issue?.fixVersions?.map(v => v?.name).join(\"','\") ") + "') ")) : null} | |
Number of labels | General | %{issue.labels.length} | |
Number of linked issues | General | %{issue.links.length} | |
Number of open child issues | General | %{count(issuesFromJQL("statusCategory in ('To Do','In Progress') and parent = " + %{issue.key}))} | |
Number of outgoing issue links | Jira expression | issue?.links?.filter(link => link.direction == "outward").length | |
Number of status changes | Jira expression | issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status')).length | |
Number of sub-tasks | General | %{issue.subtasks.length} | |
Number of sub-tasks based on status | General | %{count(filterByStatus(subtasks(), "Done, Completed"))} Please, note that by changing "Done, Completed" into other statuses and resolutions you can adapt this use case for your needs. | |
Number of sub-tasks based on status and issue type | General | %{count(filterByIssueType(filterByStatus(subtasks(), "Done, Completed"), "Sub-task, Sub-story"))} Please, note that by changing "Done, Completed" into other statuses and "Sub-task, Sub-story" into other issue types, you can adapt this use case for your needs. | |
Number of times issue was changed to the current status | Jira expression | issue.changelogs.filter(changelog => changelog.items.some(item => item.fieldId == 'status' && item.toString == issue?.status?.name)).length |