Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Converting user mentions in the cloud format when there is an incoming sync from the DC/Server

 
2
1
0

Hi there,


Can someone help me in modifying the script, so that when there is incoming sync of comments from Server/DC to cloud Jira it should convert user mentions in the cloud format so that it updates properly in the comments?


I have managed to do this on Server/DC Jira when there is incoming sync from the cloud. However, I am facing difficulties while doing the same for the cloud.


Please help me with this.


Thanks,

Eshwar.

  1. Serhiy Onyshchenko

    Hey, Eshwar Palem, might I ask you to share your Outgoing sync script from on-prem
    and your incoming sync script for cloud (maybe just the parts concerning comments)?

CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    Also have you seen this article?
    https://community.atlassian.com/t5/Agile-articles/How-to-sanitize-mentions-when-synchronizing-issues/ba-p/1141139
    you could replace every mention sent from server with email:

    /*
    ** This code snippet illustrates how mentions can be replaced with the actual name of the mentionee
    ** Use this in a data filter
    */
    
    
    replica.comments	   = issue.comments.collect {
    			  comment ->
                  
    
                  def matcher  = comment.body =~ /\[~(\w+)\]/
                  def newCommentBody = comment.body
    
                  matcher.each {
                      target = "[~$nodeHelper.getUser(it[1])?.email]"
                      newCommentBody = newCommentBody.replace(it[0], target)
                  }
    
                  comment.body = newCommentBody
                  comment
    }

    And then use similar logic on cloud to lookup a user using email
    Please, let me know if this helps

      CommentAdd your comment...