How to Sync Comments in Xurrent

    This article describes how to synchronize comments between Xurrent and other systems.

    Outgoing sync (Xurrent → Remote system)

    To send comments from Xurrent to the remote system, use this script in your Outgoing Sync:

    replica.comments = entity.comments

    To send comments from Xurrent to the remote system while maintaining formatting, use this script in your Outgoing Sync:

    1.  When remote system is using Wiki e.g. Jira

     replica.comments = entity.comments.each {                                 
          if (it.body) {                                                                                   
              it.body = nodeHelper.convertXurrentToWiki(it.body)                                           
          }                                                                                                
      } 

    2.  When remote system is using HTML e.g. ADO

     replica.comments = entity.comments.each {                                 
          if (it.body) {                                                                                   
              it.body = nodeHelper.convertXurrentToHTML(it.body)                                           
          }                                                                                                
      } 

    Incoming sync (Remote system → Xurrent)

    To receive comments from the remote system and add them to Xurrent, use this script in your Incoming Sync:

    entity.comments = commentHelper.mergeComments(entity, replica)
    What this does: The mergeComments helper merges new comments with existing ones, avoiding duplicates while preserving comment history.

    To receive comments from the remote system and add them to Xurrent while maintaining formatting, use this script in your Outgoing Sync:

    1.  When remote system is using Wiki e.g. Jira

    issue.comments     = commentHelper.mergeComments(issue, replica,
                           {
                           comment ->
                           comment.body = nodeHelper.convertWikiToXurrent(comment.body)
                            })

    2.  When remote system is using HTML e.g. ADO

    issue.comments     = commentHelper.mergeComments(issue, replica,
                           {
                           comment ->
                           comment.body = nodeHelper.convertHtmlToXurrent(comment.body)
                            })
    Note: Xurrent platform has limitation that it will not allow notes/comments updation and deletion. So mergeComments will add new comments only 

    More information

    Have more questions? Ask the community