This template displays the display name of the author of the first comment posted in the current work item.
If there is nothing to display, the result will be “None”.
Configuration
To use the First comment author template, simply select it from the template grid. Filter by Comment to find it faster.
Parameters
This template does not require any additional parameter configuration.
Expert mode
If you switch to Expert mode you can see the formula field in the Expression Parser. You can now tweak the expression to create a custom formula field based on this template.
Expression
Jira expression:
issue?.comments[0]?.author?.displayName
Details
1. What does the expression do?
The expression retrieves the display name of the person who wrote the very first comment on the current work item. If there are no comments, or if the information is missing, the field will display “None”.
2. Step-by-step breakdown
-
issue?
This refers to the current work item. -
.comments[0]?
This accesses the list of comments on the work item and selects the first one ([0]). -
.author?
This gets the author information from the first comment. The?means that if the author information is missing, it won’t cause an error. -
.displayName
This retrieves the display name (the full name as shown in Jira) of the author of the first comment.
3. Examples
-
If the first comment on a work item was written by “Jane Doe”, the expression will return “Jane Doe”.
-
If there are no comments on the work item, the expression will return nothing.
4. Real-life use cases
-
Displaying the name of the person who started the discussion on a work item, for quick reference.
-
Creating reports or dashboards that show who typically initiates conversations on work items.