How to Configure Sync to Multiple Repositories in GitHub

    Starting from Exalate for Github version 5.4.0 you can configure sync to multiple repositories in GitHub using only one Scripted connection.

    This feature will save you lots of time when configuring initial synchronization logic and maintaining it in the future. 

    You can use this functionality to connect your GitHub with multiple entities in Jira, Salesforce, Azure DevOps, or another GitHub instance.

    If you plan to convert an existing connection, please reach out to our support department to smooth your transition. 

    In the following example, you can see how to sync issues from multiple Jira Cloud projects to multiple GitHub repositories.

    GitHub Incoming sync rules

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    if (firstSync) {
         
        //jira project -> to first repository
        if (replica.project.key == 'Jira-A') {
            issue.repository   = 'repoA'
       }
        
       //Other jira project -> second repository
       else if (replica.project.key == 'Jira-B') {
            issue.repository  =  'repoB'
        }
         
        //from any other projects to certain repository
        else{
            issue.repository  =  'repoC'
        }
    }
    issue.summary      = replica.summary
    issue.description  = replica.description
    issue.comments     = commentHelper.mergeComments(issue, replica)
    issue.labels       = replica.labels
    issue.assignee     = nodeHelper.getUserByUsername(replica.assignee?.username)
    issue.reporter     = nodeHelper.getUserByUsername(replica.reporter?.username)

    In this example, issues from Jira Cloud project "Jira-A" will be synced into GitHub repo "repoA", and issues from Jira Cloud project "Jira-B" will be synced into GitHub repo "repoB".  Any other Jira Cloud project issues will be synced into GitHub repo "repoC".