Originally asked by Cian Mackle on 02 September 2021 (original question)
I’m trying to sync issues between GitHub and Jira Cloud and I’m having difficulty mapping the users. Neither the reporter or assignee objects in GitHub have the email information attached. The other information like username, key etc. is present. See screenshot below taken from the replica in Jira Cloud:
(I’m also unsure of why active is false)
I am an owner in the GitHub organization and an admin in the project. Does anyone know why I might not be seeing the user email?
Comments:
Andrii Markov commented on 02 September 2021
Hi Cian Mackle ,
Can you please confirm if you use the Visual connection or the Scripting one?
If it’s Visual, could you please provide me a screenshot of the user mapping
If it’s Scripting, could you please share with me the outgoing and incoming rules?
Thanks,
Andrii
Cian Mackle commented on 02 September 2021
Hi Andrii,
I am using a Scripting connection.
Here are the scripts:
Outgoing Sync (GitHub side)
replica.key = issue.key
replica.assignee = issue.assignee
replica.reporter = issue.reporter
replica.summary = issue.summary
replica.description = issue.description
replica.labels = issue.labels
replica.comments = issue.comments
replica.status = issue.status
replica.project = issue.project
Incoming Sync (Jira Cloud side)
if(firstSync) {
issue.projectKey = "ABC"
issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = attachmentHelper.mergeAttachments(issue, replica)
issue.labels = replica.labels
def reporter = nodeHelper.getUserByEmail(replica.reporter?.email)
if(reporter){
issue.reporter = reporter
}
From adding thrown exceptions and looking at the errors messages I can see that the reporter email is missing on the Outgoing sync, even before setting the value on the replica.