mergeComments—with custom formatting
Last Modified on 02/25/2026 10:10 am EST
This article applies to Exalate Classic only. If you're using the New Exalate experience, please refer to the New Exalate documentation.
| Helper |
|
| Signature |
mergeComments(IHubIssue issue,IHubIssue replica, Closure commentChangeFn) |
| Description |
Allows formatting the comment when merging remote comments. Use a closure to define how the merged comment body should be formatted.
|
| Introduced |
0.10 |
// provide a custom format of the comment during update/create of comments
issue.comments = commentHelper.mergeComments(issue, replica,
{
comment ->
comment.body =
"[" + comment.author.displayName +
"| mailto:" + comment.author.email + "]" +
" commented: \n" +
"{quote}\n" +
comment.body + ";\n" +
"{quote}\n"
})
- Use the script to impersonate the comment
// set the real comment author for all comments; if the author is null set a default user
issue.comments = commentHelper.mergeComments(issue, replica) {
if (it.author) it.executor = it.author
else it.executor = nodeHelper.getUserByEmail("default user email"); it
}
- Any field available in the Comment object can be used to format the comment.