GitHub comment impersonation

Originally asked by Guilherme Duarte on 28 July 2020 (original question)


Is it possible to impersonate comments on GitHub during import from an external source?

I’ve tried the documented methods but with no luck… Source: Github Cloud (old community)


Answer by Ariel Aguilar on 14 July 2021

Hi Guilherme,

The best you could do since there is a limitation with the Proxy user on Github, the name cannot be modified. Then, you can impersonate the author on comments as you add an indicator string. So yo could do:

issue.comments = commentHelper.mergeComments(issue, replica,                      
                    {
                       comment ->
                       comment.body =
                          "[" + comment.author.email + "] " +
                          comment.body + "\n" 
                    }
)
//This will help to add a reference from the email/author coming from Jira on each GitHub comment.

Kind regards,

Ariel