Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Setting a project based on the source issue custom field value for server-cloud synchronization

 
1
0
-1

Hello.

We are syncing a server project with multiple cloud project and would like to use component value from origin project to set destination project in cloud instance. i.e.

If origin component == Member, destination project == MPM

if origin component == Sales, destination project == SBA

etc.

I found some articles describing something similar, but the code described in those articles “works for local synchronization only”.

Is there a code that works for server-cloud synchronization?

Thank you.

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Adrian,

      Please try the following snippet into Jira Cloud incoming script:

      if(firstSync){
      //Member is Remote component name - MPM is Desired local project key
      def componentNameToProjectMap = ["Member":"MPM", "Sales":"SBA"]
      issue.projectKey   = replica.components.collect { component -> componentNameToProjectMap[component.name] }.find{it != null} ?: "MPM"
      //?: "MPM" Refers to default project if not found
      issue.typeName     = nodeHelper.getIssueType(replica.type?.name, issue.projectKey)?.name ?: "Task"
      }

      Kind regards,

      Harold

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Harold Oconitrillo documentation https://docs.idalko.com/exalate/x/4wB1Aw covers "How to sync components in Jira on-premise". What we need is to use the component value coming from the source side to select/set the destination project value. The document i found https://docs.idalko.com/exalate/display/ED/How+to+set+the+project+based+on+the+source+issue+custom+field+value shows how we can set the project based on the source issue custom field value but the code "works for local synchronization only" and our synchronization is between one server project and multiple cloud projects.


        Thanks.


        Adrian

          CommentAdd your comment...
        1.  
          1
          0
          -1

          Hi,

          Certainly, you may review the below documentation

          https://docs.idalko.com/exalate/x/4wB1Aw 

          Kind regards,

          Harold Cruz

            CommentAdd your comment...