Originally asked by Lara LG on 16 March 2021 (original question)
Hello,
Some of my synced users are customers who have never gone into Jira or have any group. This breaks my exalate when in sycn with Jira software project, since they need permissions. I was trying to impersonate these users, but I am not sure if this code would be correct, can I check the group of the commenter?
if(replica.project.key == "IMPORTAL"){
issue.projectKey = "IM"
issue.typeName = nodeHelper.getIssueType(replica.typeName)?.name ?: "Incident"
//issue.comments = commentHelper.mergeComments(issue, replica, { comment -> comment.executor = comment.author})
if (userHelper.isGroupMember(comment.author.username, "jira-users")){
issue.comments = commentHelper.mergeComments(issue, replica, { comment -> comment.executor = comment.author})
}
issue.comments = commentHelper.mergeComments(issue, replica, { comment ->
comment.executor = nodeHelper.getUserByUsername("new.comment")
comment.body = comment.author.displayName +" said : "+ comment.body
})
}