How to Make Attachments from Transition Screen Visible to Customers using JMWE cloud
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
Ensure you have administrative access to Jira.
Steps
Identify the Transition Screen:
Navigate to the workflow associated with your project.
Identify the transition where you want to add the attachments.
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 }}
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
.
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.
Reference screenshots:
Attached added as an internal comment during the transition:
Attachment available as a public comment on the portal.
Â