1
0
-1

Hi,


Currently, I have a connection between Jira and Azure.


I want to know, if it is possible in Azure to decide to which project to save the task.

In the connection settings it lets you choose a single project. I have tried in the code to do something like this: "workItem.projectKey =" Test "" or "workItem.project =" Test "" or "workItem.project? .Name =" Test "


But it doesn't work always save to project I selected in settings.


Can you help me?



I remain attentive to your comments.
Regards.

    CommentAdd your comment...

    6 answers

    1.  
      1
      0
      -1

      Hi Anyer ,


      In this way Exalate for Azure doesn't support synching issues to multiple projects.

      However, we would like to suggest you a workaround with creating multiple connections: one for each Azure project with specifying a filtering condition, i.e.:


      if (replica.project.key != "FromJira") {
          return
      }
      


      And set triggers to navigate synchronised issues to the needed projects.

      Please let us know if it helped you.


      Kind Regards,
      Andrii

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

        Anyer ,


        It is just an example script, you might want to add your defined objects and your value as well.


        So if you have workitem.projectKey instead of issue.projectKey, you should replace it with your object.


        Kind Regards,
        Andrii


        1. Anyer

          Hi Andrii,


          I understand that they are test script. 


          Really what I want to know, is how should I configure the script in Azure to be able to create the task with a key that I will send to it from Jira.


          I have this configuration in the Incoming: 


          if(firstSync){
             // Set type name from source entity, if not found set a default
             workItem.typeName = nodeHelper.getIssueType(replica.type?.name)?.name ?: "Task";
          }

          workItem.summary      = replica.summary
          workItem.description  = replica.description
          workItem.status       = replica.status
          workItem.attachments  = attachmentHelper.mergeAttachments(workItem, replica)
          workItem.comments     = commentHelper.mergeComments(workItem, replica)
          //workItem.IdVentanilla     = replica.customFields."IdVentanilla".value
          workitem.projectKey = "Test"


          But this does not work, is what I commented in the summary of this Post. 


          With this script, the incident is created in the project indicated in the configuration. 


          I do not want you to believe in this project, but in whatever I tell you. 

          I remain attentive to your comments.

          Regards.


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

        Hi,


        This:

        issue.projectKey = "PVR"


        Can I run it the same on Azure? 


        How is it? So:

        workItem.projectKey 


        I remain attentive to your comments.

        Regards.


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

          Hi @Anyer,


          If you want to use the scripting rule, you may specify your needs with IF/ElSE conditions:


          if(firstSync){

          if(replica.'Product/Category'.parent?.value == null)

          {

          return

          }

          else if(replica.'Product/Category'.parent.value == 'PV Reports' ){

          issue.projectKey = "PVR"

          }

          else if(replica.'Product/Category'.parent.value == 'PV Central' ){

          issue.projectKey = "PVC" }

          else if(replica.'Product/Category'.parent.value == 'PV Signal' ){

          issue.projectKey = "PVS"

          }


          Please let me know if it does help you.


          Kind Regards,
          Andrii

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

            Hi,


            I tell you, from Jira when I go to scale, I will send the project key and the type of issue where the issue should go in Azure. I understand from what you say, that I can upload a CSV with all the project keys and then in the script Can I choose which project to save the task to? If so, how is this done? 


            I change it like this:

            workItem.projectKey = "Test" 


            I remain attentive to your comments.

            Regards.

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

              Hi Anyer ,


              If I understood you correctly, you might want to use Bulk Connection.
              You can provide a mapping of issue keys on .csv file, so it will not be up to the particular project.

              More you can find right here:
              https://docs.idalko.com/exalate/display/ED/Bulk+Connect 


              Also it could be done with a single issue:

              https://docs.idalko.com/exalate/display/ED/Connect+Operation


              Please let us know if there is still something we can help you with.


              Kind Regards,
              Andrii

                CommentAdd your comment...