Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 on how to achieve this:

Prerequisites

...

  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:

      Code Block
      {% 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 during the transition.

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

...