How to impersonate comments when synchronizing between two instances

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 21, 2016

Two teams are working on their own JIRA to track the development of a common product.  They agreed to synchronise all issues between the two instances.  One of the challenges encountered was that the comments made on one instance, should be also made on the local instance, and the way around.

As both instances have a completely different user base, there is a need to be able to lookup the local user based on the email address of the remote user such that comments can be created with the mapped local user.

 

There are multiple issue sync solutions on the market (check here), and the question is how does each of these solve this problem ?

 

 

2 answers

13 votes
Matthias Gaiser _K15t_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 22, 2016

I compared how three of the issue sync solutions with the most active installations handle this situation. In my opinion, the most important part is that people want to know which person commented on the issue on the remote issue. This can be solved by either creating a comment with this real user (user impersonation) or by commenting with a technical user and including the user information into the actual comment (comment enrichment).

Here are the results of my analysis:

  • Exalate
    • Comment Enrichment
      By default, Exalate adds a prefix with the comment author. I guess you could modify the script in order to adapt it to your needs.
      exalate-enrichment.png
    • User impersonation
      Creating the comment as the actual user is supported by providing a script as Francis mentioned. Unfortunately I could not get it running myself. @Francis Martens (iDalko) - can you check the script again?
  • Issue SYNC - Synchronization for JIRA
    • Comment Enrichment
      This addon also adds a prefix to every comment.
      intenso-enrichment.png
    • External Comments tab
      Alternatively, you can activate the external comments tab. Then only comments added in the external comments tab will be synchronized (see the documentation). If the user exists, it will be highlighted (see Administrator), if it does not exist, the name of the user is just being added as usual text.
      intenso-external-comments.png
  • Backbone Issue Sync for JIRA
    • Anonymous
      No user information will be added to the comment.
    • Comment Enrichment
      Backbone will add an enrichment text which you configured in the UI, by default.
      backbone-enrichment.png
      The documentation contains more information how to configure it.

 

If you know how the other sync solutions handle these cases, please comment here, and I am happy to edit my answer.

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 22, 2016

Hi Mathias,  

I do agree that in most cases, knowing who added the comment is sufficient.

Comment impersonation, and the ability to create users on the fly is required for business cases which need project mirroring or migration scenarios where you need to move issues from one instance to another.

If you have the time to detail out the problems that you encounter with the script, we are happy to help out.  Just send whatever information to support@exalate.com

Francis

 

 

 

4 votes
francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 21, 2016

Exalate allows to create and impersonate users with a very straightforward script

 

issue.comments = commentHelper.mergeComments(issue, replica, {  comment ->
   
  def author = userHelper.getByKey(comment.author.username)
   
  // set the executor, optionally create the user is the local user is not found
  comment.executor = author ?: userHelper.createUser (comment.author.username,
                                                     "changeme", //password !
                                                     comment.author.email,
                                                     comment.author.displayName
                                                    )
  comment
   
})

 

 

Check for more information How to impersonate a comment

 

Francis

MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2016

Looks like that feature will use up one of your user licenses, right?

francis
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
December 22, 2016

Depends on the version and the global permissions of the target instance (where the comment is being delivered)


What combination are you looking for ?

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events