We are using Exalate connect option to sync existing Jira issue with existing github issues/PR’s.
When we sync with Github we have below script placed in Jira incoming script.
if(firstSync){
syncHelper.syncBackAfterProcessing()
}
issue.projectKey = “SWDEV”
// Set type name from source issue, if not found set a default //issue.typeName = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: “Defect”
//} //issue.summary = replica.summary //issue.description = replica.description
issue.customFields.“GITHUB ID”.value = replica.key
issue.customFields.“GitHub Status”.value = replica.status.name
issue.customFields.“Github link”.value = remoteReplica.payload.issueUrl
Sync status according to the mapping [remote issue status: local issue status]
If statuses are the same on both sides don"t include them in the mapping
def statusMapping = [“Open”:“New”, “To Do”:“Open”]
def remoteStatusName = replica.status.name
issue.setStatus(statusMapping[remoteStatusName] ?: remoteStatusName)
*/
issue.labels = replica.labels
issue.assignee = nodeHelper.getUserByUsername(replica.assignee?.username)
issue.reporter = nodeHelper.getUserByUsername(replica.reporter?.username)
---------------------------------------------------------------------------------------------------
Please help with your inputs on this
Initially it should be possible to sync Github fields to Jira customfields as long as the value of both fields match.
In order to understand what is failing in your current configuration please confirm the following:
What is the value type of the customfields created in Jira, do they match the type of value being passed by the fields from Github?
I see you are using syncHelper.syncBackAfterProcessing() according to this documentation the issue.key customfield script should be set on the incoming script of the opposite side. Have you tried this implementation?
Additionally, could you also share the scripts from the outgoing sync?
Thanks,
Comments:
Varun commented on 09 November 2022
Hi Ezequiel Consorti ,
Thanks for your response.
Here are the details steps :
Trying sync between Jira and Github with Connect option in Jira
After exalating with github.
We are expecting two fields to be updated immediatly in Jira with github status and github url for that we are using the below script
This line of code helps to send back certain information to the source side once the issue is created on the destination side.
If what you wish to do is to set customfields from Github to Jira on the first sync, you would need to add the script for those customfields inside the if(firstSync){}.
Additionally I see you are using the syncHelper but I do not see any customfield being shared back to github, because of this I believe that there is no need for the syncHelper in the Jira incoming scripts. More info on how this helper works.