Breadcrumbs

Attachment authors

📚

This template displays the display name of the authors of the attachments in the current work item.

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

Configuration

To use the Attachment authors template, simply select it from the template grid. Filter by Attachment 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?.attachments?.reduce((result,att) =>
                result.set(att.author.displayName,""),
            new Map()).entries().flatten().filter(entry => entry != "")

Format

Default

Details

1. What does the expression do?

This expression collects and displays the display names of all attachment authors for the current work item. If there are no attachments, it will show “None”.


2. Step-by-step breakdown

Let’s break it down:

  • issue?.attachments?

    • This safely accesses the attachments of the current work item. The ? ensures it won’t cause an error if there are no attachments.

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

    • This goes through each attachment (att) and adds the author’s display name to a Map (a collection of unique keys).

    • result.set(att.author.displayName, "") adds the author’s name as a key, ensuring each author appears only once, even if they added multiple attachments.

  • .entries()

    • This gets all the key-value pairs from the Map. In this case, the keys are the authors’ display names.

  • .flatten()

    • This turns the list of entries into a simple list, making it easier to work with.

  • .filter(entry => entry != "")

    • This removes any empty entries, ensuring only valid author names are shown.


3. Examples

  • If a work item has three attachments from Alice, Bob, and Alice again, the result will be: Alice, Bob (each author appears only once).

  • If there are no attachments, the result will be: None.


4. Real-life use cases

  • Audit and tracking: Quickly see who has contributed files to a work item for accountability or review.

  • Collaboration: Identify all team members who have provided supporting documents or evidence for a task.

  • Reporting: Generate lists of contributors for compliance or documentation purposes.