Keeping original commentor's name

Originally asked by ben friedman on 03 November 2020 (original question)


Hi,

i have a connection between ZD and JSD.comments that are coming in from JSD appear under the same name in ZD, regardless of the agent who made them in JSD.

i want the comment to be posted with the name of the commenting user in JSD.

is that possible?

for that to happen, does the commenting user in JSD need to exist also in ZD?

If it is the case, that for the JSD commentor’s name to appear in ZD they have to exist in ZD, id like instead to add the commentor’s name from JSD to the comment.

please advise on the script to add for either:

1. using the JSD commentor name in ZD as the commentor.

2. adding the JSD commentor name to the comment on ZD.

ThanksBen.


Answer by brian shen on 14 February 2022

Add this to your ZD incoming sync:

replica.addedComments.each { it.executor = nodeHelper.getUserByFullName(it.author.displayName) }
issue.comments = replica.addedComments

Answer by ben friedman on 05 November 2020

any assist please?