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.
Comments:
Serhiy Onyshchenko commented on 19 March 2021
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)?
/*
** 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