Exalate is used as reporter if user's email was not found in Jira

Originally asked by Valeriy Ivanov on 18 February 2021 (original question)


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?

I have the following script for this

issue.reporter = nodeHelper.getUserByEmail(issue.reporter?.email)

But it doesn’t seem to work


Answer by Jonathon Irwin on 22 February 2021

You certainly can create the customer if required (provided the Exalate user has permissions to do so).

As per https://docs.idalko.com/exalate/display/ED/createUser:

You should be able to go:

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
}

Answer by Valeriy Ivanov on 18 February 2021

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?