1
0
-1

we have one of our requirements to sync issues from multiple JIRA projects on a local instance to a JIRA project in remote instance, wherein issues need to be synced from multiple projects to one project, more like many to one mapping ( some fields from a project and some from another to a project in remote JIRA instance). In hoping to do so, I tried to assign issue key in the incoming sync on the remote so that it updates the issue instead of creating a new one but a new issue was created instead of updating the exiting issue whose key was passed in. Is there a way of achieving this, any suggestion will be super helpful. Thank you

  1. Sai Thakur

    Thank you for the reply but I am looking for a configuration that can be put in place instead of manual intervention and sync only some selected fields from local issue to remote issue.

CommentAdd your comment...

1 answer

  1.  
    2
    1
    0

    Hi!

    Something that is possible with exalate is to automatic connect to a remote issue based on a custom field value representing the remote issue key, in that case, your outgoing script would look like this:

    import com.atlassian.jira.component.ComponentAccessor
    import com.exalate.api.replication.out.IEventSchedulerService
    import com.exalate.api.trigger.ISyncInitiationService
    
    def syncService = ComponentAccessor.getOSGiComponentInstanceOfType(ISyncInitiationService.class)
    
    def ess = ComponentAccessor.getOSGiComponentInstanceOfType(IEventSchedulerService.class)
       
    if(firstSync && syncType == "EXALATE"){
      def remoteIssueKey =  issue.customFields."Remote Issue"?.value
      if(remoteIssueKey){
        syncService.connect(
          issue.key, // specify the issue key you want
          remoteIssueKey, // specify the issue key you want
           connection.name, // set the relevant connection name
          ,false, true, true, false
        )
        ess.scheduleSyncEventForConnectedIssue(issueKey, connection)
      }
    }else{
        replica.summary = issue.summary
        replica.description = issue.description
        replica.status = issue.status
        replica.attachments = issue.attachments
        replica.key = issue.key
        replica.workLogs = issue.workLogs
    }


    In this example, when the issue is exalated (this can be automated with a trigger) it will be connected with the remote issue based on a custom field named "Remote Issue". Would this work for your case?



    1. Sai Thakur

      This might work for us, I will implement and let you know. Thank you so much, great help.

    CommentAdd your comment...