Sync Comments and Copy Attachments in Linked Jira Cloud Work Items
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
When customers report Bugs or other work items via a Service space, it may also be required to raise the same ticket on a Jira space so developers can work on a fix.
Solution
Using automation to sync comments
When Tickets are linked, comments can be copied from one to another using an automation rule.
The rule will be triggered as soon as the comment is added to a ticket, and it’s possible to post it as a public comment. This option will allow developers to receive comments from customers and customers to receive updates from developers.
Note that Global and Multiple project rules count towards the Automation execution limit. For more details, refer to the documentation How is my usage calculated?
Review the attachment scope before copying
Option 1 is manually triggered; it is not the comment-added rule in Option 2. Its attachment-copy action copies attachments from the trigger work item, and the {{#attachment}} loop lists attachments on the work item in the branch. It does not select only files introduced by the latest comment.
Review the attachments and destination access before running this rule. Do not use this work-item-wide copy route when some source attachments must remain internal or unavailable to the linked destination's audience.
Option 1
Create an Automation via System > Global Automation if you're using tickets from different spaces so you can select the Scope as All spaces or Multiple spaces.
If you will run this Automation by copying attachments from the same space, create an Automation via Space Settings > Automation.
When > New trigger > Manual trigger.
New branch > Branch rule/Related work items > Linked issues.
New action > Edit work item field Attachment and select Copy Attachment from Trigger work item.
New action > Re-fetch work item data.
New action > Comment on work item and use the smart value {{#attachment}} !{{filename}}|thumbnail! {{/}}
Option 2
Create an Automation via System > Global automation. As tickets will be in different spaces, select the Scope as All spaces or Multiple spaces.
When > New trigger > work item commented.
Protect internal comments - Do not configure an unrestricted comment-copy rule to publish every source comment to customers.
For a rule that copies customer-visible JSM comments, add a smart-values condition before the linked-work-item branch: {{comment.internal}} must equal false. Continue to the public Comment on work item action only for comments that satisfy this condition.
For developer-to-customer updates, explicitly select which comments are approved for customer publication. A developer comment is not automatically customer-safe because it exists on a linked work item. Keep internal notes and restricted comments out of this public-copy route, and test both directions separately before enabling it.
2. New branch > Branch rule/Related work items > Linked work items.
3. New action > Comment on work item and use the smart value {{comment.body}}. Make sure to uncheck the option Prevent duplicates by only adding this comment once to a particular work item to make sure all comments will be copied.
Copying the attachments from Comments
Due to a known bug, when copying comments from one ticket to another, the attachments on the destination ticket might show Failed to load: AUTO-723 - Cloned comments using Automation shows attachments as "Failed to load".
The workaround for this known bug is:
Add a New action > Edit work item.
After selecting the Attachment on Choose fields to set..., select the Work item to copy value from > Trigger work item.
Was this helpful?