// Sync all incoming comments as internal notes
// issue.comments += replica.addedComments
issue.comments = commentHelper.mergeComments(issue, replica) { it.internal = true; it }
issue.attachments += replica.addedAttachments.collect {
it.internal = true
it
}
Comments are added as internal notes, and attachments WERE added as internal notes too, but now they’re public.
I really can’t guess why/what’s happening.
You found me! Its good to see you again, but not so good to read what is going on.
I am planning to work on this today, but just to be absolutely sure you are wanting everything (comments and attachments) coming from remote side, to be internal in Zendesk, right?
Ahh ok, thanks for sharing, I will still try to fix it in the short run so that at least you can get going until the bug is resolved.
If you still have the ticket with support open, maybe you can also ask for a workaround (shifting you to a previous version maybe).
I have worked on this matter and the issue is not on Zendesk but how JIRA sends or identify if Internal Or external comment/attachment
Here is an script that solved this matter and every attachment will be internal on your zendesk
// This script should be placed in the 'Incoming sync' rules
// Define a regular expression to find Jira's attachment markup in text.
def attachmentMarkupRegex = ~/(\[\^.+?\]|!.+?!)/
// Check if there are any comments to process
if (replica.comments) {
// Loop through each comment from the source system
replica.comments.each { comment ->
// Use the regex to check if the comment's body contains attachment markup
if (comment.body.find(attachmentMarkupRegex)) {
// 1. Set this comment to be internal (private note in Zendesk)
comment.internal = true
// 2. Add the required description to the beginning of the comment body
// This will also resolve the "Please provide a comment" error.
comment.body = "Internal attachment:\n" + comment.body
}
}
}
// Finally, assign the modified comments and attachments to the issue.
issue.comments = replica.comments
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)