Skip to end of banner
Go to start of banner

How to Make Attachments from Transition Screen Visible to Customers using JMWE cloud

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

When working with Jira Service Management (JSM), you might want to ensure that attachments added during a transition screen as part of internal comments are visible to customers. Here’s a step-by-step guide to achieve this:

Prerequisites

  • Ensure you have administrative access to Jira.

Steps

  1. Identify the Transition Screen:

    • Navigate to the workflow associated with your project.

    • Identify the transition where you want to add the attachments.

  2. Configure Post-Function to Handle Attachments:

    • In the workflow transition, add the Comment Issue Post function Comment issue(s)

    • Use the following Nunjucks script to add the attachments to the issue comments, making them visible to customers:

      {% set result = "" %}
      {% set recentAttachments = [] %}
      {% for att in issue.fields.attachment %}
          {% if now | date("diff", att.created, "seconds") <= 30 %}
              {% set ignored = recentAttachments.push(att) %}
              {% set value = att | field("filename") %}
              {% set result = result + "\n" + "!" + value + "!" + "\n" %}
          {% endif %}
      {% endfor %}
      {{ result }}
  3. Ensure Correct Order of Post-Functions:

    • Place the above post-function after the built-in post-function Update change history for an issue and store the issue in the database.

  4. Test the Configuration:

    • Perform a test transition and add an attachment.

    • Verify that the attachment appears in the issue comments and is visible to customers on the portal.

Reference screenshots:

Attached added as an internal comment during the transition:

2024-09-13_17-40-40-20240913-121047.png

Attachment available as a public comment on the portal.

2024-09-13_17-42-39-20240913-121245.png

  • No labels