On the initial JSD when user creates a request - reporter field is filled with user’s email. However, once sync comes into play, on the destination side, if user has never sent a request, reporter field is set to Exalate. How can we sync the reporter?
if (replica?.reporter?.key) { // added this line to exclude trying to make a user if this value is null
def reporterUser= userHelper.getByKey(replica?.reporter?.key)
if (reporterUser== null) {
// create the user if s/he doesn't exist
reporterUser= userHelper.createUser(replica.reporter.username,
"passwordToChange",
replica.reporter.email,
replica.reporter.displayName)
}
//add the user as a request participant
issue.reporter= reporterUser
}
Okay, so after spending a day on this, I have figured out that there are changes in Jira API and getUser had some changes.
But I believe the root case is even deeper, seems like if the customer doesn’t exist in master instance it won’t be synced with his email and only ‘Exalate’ would be the reporter.
So the question is: is it possible to sync the customers between two instances or can I do it in script somehow? Like create customer if it doesn’t exist?