Smart Fields Examples
- 1 Total time passed in hours since the issue has been resolved
- 2 The final date to start working on an issue to finish on due date
- 3 Account Id of Previous Assignee
- 4 Previous Status
- 5 Blocking Issues
- 6 Total Worklogs by Author
- 7 Parent Priority
- 8 Parent Assignee
- 9 Parent Status
- 10 Comment Authors
- 11 Last Status Author
- 12 Project Category
- 13 Project Lead
- 14 Assignees of Sub-tasks
- 15 ICE Score
- 16 Time Spent - Original Estimate Ratio
Total time passed in hours since the issue has been resolved
1- Login to JIRA as an administrator.
2- Go to Settings → Issues → Custom Fields.
3- Create a custom field with Smart Number Field type. Don’t forget to add it to related screens.
4- Locate the custom field you created in the custom fields list.
5- From the actions, choose “Contexts and default value”.
6- Click on “Edit custom field config”.
7- Enter the expression below to “Insert Jira Expression” editor.
8- Save your configuration.
issue.resolutionDate ?
(new Date()).minusMinutes(issue.resolutionDate.getTime() / (1000 * 60))
.getTime() / (1000 * 60 * 60)
: null
The final date to start working on an issue to finish on due date
1- Login to JIRA as an administrator.
2- Go to Settings → Issues → Custom Fields.
3- Create a custom field with Smart Text Field type. Don’t forget to add it to related screens.
4- Locate the custom field you created in the custom fields list.
5- From the actions, choose “Contexts and default value”.
6- Click on “Edit custom field config”.
7- Enter the expression below to “Insert Jira Expression” editor.
8- Save your configuration.
issue?.dueDate && issue.originalEstimate ?
issue?.dueDate.minusDays(issue.originalEstimate / (60 * 60 * 8)).toISOString()
: ""
Account Id of Previous Assignee
1- Login to JIRA as an administrator.
2- Go to Settings → Issues → Custom Fields.
3- Create a custom field with Smart Text Field type. Don’t forget to add it to related screens.
4- Locate the custom field you created in the custom fields list.
5- From the actions, choose “Contexts and default value”.
6- Click on “Edit custom field config”.
7- Enter the expression below to “Insert Jira Expression” editor.
8- Save your configuration.
issue.changelogs.map(e => e.items).flatten()
.filter(e => e.field == "assignee").length > 1 ?
issue.changelogs.map(e => e.items).flatten()
.filter(e => e.field == "assignee")[issue.changelogs.map(e => e.items).flatten().filter(e => e.field == "assignee").length - 2].from
: ""
Previous Status
issue.changelogs.map(i=>i.items)
.flatten()
.filter(i=>i.field=="status").length>0 ?
issue.changelogs.map(i=>i.items)
.flatten()
.filter(i=>i.field=="status")
.map(a=>a.fromString)[0]
: ""
Blocking Issues
issue?.links?.filter(e => e?.type?.inward == "is blocked by" || e?.type?.outward == "blocks")
.map(e => e?.inwardIssue?.key != issue?.key ? e?.inwardIssue?.key : e?.outwardIssue?.key)
Total Worklogs by Author
issue?.worklogs?.map(e => ({time: e.timeSpent, author: e.author.displayName}))
.reduce((result, worklog) => result.set(worklog.author, (result[worklog.author] || 0) + worklog.time), new Map())
Parent Priority
issue?.parent?.priority?.name
Parent Assignee
issue?.parent?.assignee?.displayName
Parent Status
issue?.parent?.status?.name
Comment Authors
issue?.comments?.map(comment => comment.author?.displayName)
Last Status Author
issue.changelogs.filter(c => c.items.some(i => i.field=="status"))[0]?.author.displayName
Project Category
issue.project?.projectCategory?.name
Project Lead
issue.project?.lead?.displayName
Assignees of Sub-tasks
issue.subtasks?.map(e => e.assignee?.displayName)
ICE Score
issue.cfIIIII * issue.cfCCCCC * issue.cfEEEEE
Replace IIIII
, CCCCC
and EEEEE
with your following number custom fields:
IIIII
→ Impact
CCCCC
→ Confidence
EEEEE
→ Ease
Time Spent - Original Estimate Ratio
issue.timeSpent && issue.originalEstimate ? issue.timeSpent / issue.originalEstimate : 0