Originally asked by Yogesh Mude on 09 March 2021 (original question)
If Ganesh, Tejal, and Pradnya logged the time on the Jira server ticket then working should log as Yogesh user/author on the Jira cloud ticket.
And except for these three users if anybody logged the time on the Jira server ticket then the worklog should log as admin user/author on Jira cloud ticket.
For the same, I have gone through the below Exalate article and added code to the destination (Jira cloud) incoming sync for existing issues but it’s not working as expected.
https://docs.idalko.com/exalate/display/ED/Worklogs+synchronization
but Every time it’s logging the time as Yogesh author on Jira cloud, irrespective of the user who logged the time on Jira server.
final def userMapping = [
"pradnya" : "yogesh",
"tejal" : "yogesh",
"ganesh" : "yogesh",
"boudewijn" : "admin"
]
issue.workLogs = workLogHelper.mergeWorkLogs(issue,replica, { w ->
w.author = nodeHelper.getUser(userMapping[w.author?.email]) ?: w.author
w.updateAuthor = nodeHelper.getUser(userMapping[w.updateAuthor?.email]) ?: w.updateAuthor
w.comment = "auto-synced worklog from Brain2"
})