Trim comment length in Jira Cloud

I’m getting an error about the length of a comment being over 32,767 when using

issue.comments = commentHelper.mergeComments(issue, replica)

What can I do? I’m happy to trim the comments before but it doesn’t seem to help

To address this, you can trim the comment length before merging the comments by modifying your Jira Cloud Incoming script as follows:

issue.comments = commentHelper.mergeComments(issue, replica, { it.body = it.body.take(32767); it })

This will take only the first 32,767 characters of each comment before merging. You can adjust the 32,767 to a different value if needed.

I hope this helps!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.