Hi All,
I have seen a few posts around this, but wanted your help, essentially I have sync between Zendesk and Jira, Zendesk cant received attachement that is more than 50mb. This causes the push a sync error.
I have a code: issue.attachments.findAll {it.filesize <= 50000}
This works fine, as it ignores the sync, but the text shows a script
I have tried the alternative
replica.key = issue.key
replica.type = issue.type
replica.assignee = issue.assignee
replica.reporter = issue.reporter
replica.summary = issue.summary
replica.description = issue.description
replica.labels = issue.labels
replica.comments = issue.comments
replica.resolution = issue.resolution
replica.status = issue.status
replica.parentId = issue.parentId
replica.priority = issue.priority
// Exclude attachments larger than 50,000 bytes
List filteredAttachments = issue.attachments.findAll { it.filesize <= 50000 }
replica.attachments = filteredAttachments
replica.project = issue.project
// Add a comment if some attachments were excluded due to size
if (issue.attachments.any { it.filesize > 50000 }) {
def warningMsg = “Some attachments were not synced because they exceeded the 50,000 bytes size limit. Please see the Jira ticket for the original files.”
replica.comments = commentHelper.addComment(warningMsg, replica.comments)
}
/*
Uncomment these lines if you want to send the full list of versions and components of the source project.
replica.project.versions =
replica.project.components =
/
/
Custom Fields (CF)
How to send any field value from the source side to the destination side.
1/ Add the value to the replica object using the Display Name of the specific field.
2/ Uncomment this next statement out and change accordingly:
replica.customFields.“CF Name” = issue.customFields.“CF Name”
*/
// Exalate API Reference Documentation: Exalate API Reference Documentation
So on first sync this when the attachment is vast it works fine, however when testing and I add a second attachment in Jira, the sync errors out.
All I want is to prevent to sync from erroring, to send a comment to zendesk that the attachments are too large and sends a comment.
The error showing its unexpected and unsure how solve this issue. Any guidance on what I could be missing? Please advise?
