Getting "Failed to Load" error when copying comments from one issue to another using Automation
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
When using Automation to copy comments from one issue to another the comment added by the automation to the destination issue displays the following error: "Failed to Load".
Environment
- Jira Cloud.
- Jira Service Management Cloud.
Cause
This error is seen if the comment from the source issue has an attachment added to the comment. When there is an attachment added in a comment, the comment will only have a reference to the attachment that is actually added to the issue.
While using any variant of the smart value {{comment.body}} to add a comment to an issue it does not add the actual attachment data to the destination issue, hence the destination issue comment refers to an attachment that is not actually present in the issue.
Solution
To prevent this you can use an Edit Issue action to edit the Attachment field right before the Add comment to issue action to copy all the attachments from the source issue to the destination issue, this way the attachment reference added in the comment is pointing to an actual attachment added in the issue:
The Edit Issue action added to copy all attachments from Source to Destination issue, if executed multiple times is not going to add duplicate attachments.