Breadcrumbs

Comment authors

📚

This template displays the names of all authors of comments in the current work item.

Repetitions of users will be omitted.

If there is nothing to display, the result will be “None”.

Configuration

To use the Comment authors 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.reduce((result, comment) => 
            result.set(comment.author.displayName, ""), 
            new Map()).entries().flatten().filter(entry => entry != "")


Details

1. What does the expression do?

This expression collects and displays the names of all unique authors who have commented on the current work item. If there are no comments, the field will show “None”.


2. Step-by-step breakdown

Let’s break it down:

  • issue.comments: Refers to all comments on the current work item.

  • .reduce((result, comment) => result.set(comment.author.displayName, ""), new Map()):

    • This loops through each comment.

    • For each comment, it adds the comment author's display name to a Map (a data structure that stores unique keys).

    • Using a Map ensures that each author’s name appears only once, even if they commented multiple times.

  • .entries(): Gets all the key-value pairs from the Map (in this case, the author names).

  • .flatten(): Converts the Map entries into a simple list.

  • .filter(entry => entry != ""): Removes any empty entries from the list.


3. Examples

  • If three people (Alice, Bob, Alice) commented, the result would be: Alice, Bob (Alice appears only once).

  • If no one commented, the displayed result would be: None.


4. Real-life use cases

  • Quickly see who has participated in the discussion on a work item.

  • Identify all stakeholders or contributors to a work item based on comment activity.

  • Use in dashboards or reports to highlight active team members.