The list below contains some use cases that can be realized using Smart Fields for Jira.
Make sure to come by once in a while since the number of use cases will grow over time.
For all examples marked with a expression editor.
, you do not even have to copy and paste the code. Simply search for the field in theUse cases and examples
Use case | Feature | Built-in | Parsing mode | Expression |
---|---|---|---|---|
All email addresses mentioned in the issue description | General | %{findPattern(%{issue.description},"(?<=mailto:)([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)")} | ||
Attachment authors | Jira expression | issue?.attachments?.reduce((result,att) => result.set(att.author.displayName,""), new Map()).entries().flatten().filter(entry => entry != "") | ||
Attachment filenames | General | %{issue.attachments} | ||
Attachment mimetypes | Jira expression | issue?.attachments?.reduce((result,att) => result.set(att.mimeType,""), new Map()).entries().flatten().filter(entry => entry != "") | ||
Comment authors | Jira expression | issue.comments.reduce((result, comment) => result.set(comment.author.displayName, ""), new Map()).entries().flatten().filter(entry => entry != "") | ||
First comment | Jira expression | issue?.comments[0]?.body?.plainText | ||
First comment author | Jira expression | issue?.comments[0]?.author?.displayName | ||
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). | ||
Issue ID | General | %{issue.id} | ||
Issue type description | Jira expression | issue?.issueType?.description | ||
Last comment | General | %{issue.lastComment} | ||
Last comment author | Jira expression | issue?.comments[issue?.comments?.length-1]?.author?.displayName | ||
Last status change author | Jira expression | issue.changelogs.filter(c=>c.items.some(i=>i.field=="status"))[0]?.author.displayName | ||
Number of affected versions | General | %{issue.versions.length} | ||
Number of attachments | General | %{issue.attachments.length} | ||
Number of comments | Jira expression | issue?.comments?.length | ||
Number of incoming issue links | Jira expression | issue?.links?.filter(link => link.direction == "inward").length | ||
Number of issues in an epic | General | %{count(issuesUnderEpic())} | ||
Number of labels | General | %{issue.labels.length} | ||
Number of linked issues | General | %{issue.links.length} | ||
Number of outgoing issue links | Jira expression | issue?.links?.filter(link => link.direction == "outward").length | ||
Number of sub-task attachments | General | %{count(fieldValue(%{issue.attachments}, subtasks()))} | ||
Number of sub-tasks | General | %{issue.subtasks.length} | ||
Parent assignee | General | %{parent.assignee.displayName} | ||
Parent priority | General | %{parent.priority} | ||
Parent reporter | General | %{parent.reporter.displayName} | ||
Parent status | General | %{parent.status} | ||
Previous assignee | Jira expression | issue.changelogs.map(i=>i.items).flatten().filter(i=>i.field=="assignee").length>0 ? issue.changelogs.map(i=>i.items).flatten().filter(i=>i.field=="assignee").map(a=>a.fromString)[0] : "" | ||
Previous issue status | General | %{issue.status.previous} | ||
Priority description | Jira expression | issue?.priority?.description | ||
Project category | General | %{issue.project.category} | ||
Project description | General | %{issue.project.description} | ||
Project lead | General | %{issue.project.leadDisplayName} | ||
Status description | Jira expression | issue?.status?.description | ||
Sub-task assignees | General | %{distinct(fieldValue(%{issue.assignee.displayName}, subtasks()))} | ||
Sub-task components | General | %{distinct(fieldValue(%{issue.components}, subtasks()))} | ||
Sub-task labels | General | %{distinct(fieldValue(%{issue.labels}, subtasks()))} | ||
Sub-task reporters | General | %{distinct(fieldValue(%{issue.reporter.displayName}, subtasks()))} | ||
Time spent ratio | General | %{{issue.timeSpent} / {issue.originalEstimate} * 100} | ||
Total attachment size in MB | Jira expression | issue.attachments.reduce((result, att) => result + att.size, 0) / 1024 / 1024 | ||
Total story points of issues in an epic | General | %{sum(fieldValue({issue.cfNNNNN}, issuesUnderEpic()))} Replace the ID with the one of your 'Story Points' custom field. |