1
0
-1

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

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      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
      }
        CommentAdd your comment...
      1.  
        1
        0
        -1

        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?

          CommentAdd your comment...