1
0
-1

Hello. And working on a POC for a client.

I am using groovy scripting method to sync.

When I create a Issue/Story in Jira I want the sync to create a matching User Story in Azure DevOps board.

Currently the work item on Azure side is defaulting to a task with same name as Story on Jira side.

How do I get the sync to create like for like items?

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Outgoing sync from Jira: (pretty much default)

      replica.key = issue.key
      replica.type = issue.type
      replica.assignee = issue.assignee
      replica.reporter = issue.reporter
      replica.summary = issue.summary
      replica.description = issue.description
      replica.labels = issue.labels
      replica.comments = issue.comments
      replica.resolution = issue.resolution
      replica.status = issue.status
      replica.parentId = issue.parentId
      replica.priority = issue.priority
      replica.attachments = issue.attachments
      replica.project = issue.project
      replica.originalEstimate = issue.originalEstimate
      replica.spent = issue.spent
      replica.estimate = issue.estimate


      //Comment these lines out if you are interested in sending the full list of versions and components of the source project.
      replica.project.versions = []
      replica.project.components = []


      Incoming sync to Azure:  (I've tried a few things, and left some of them commented out)

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

      workItem.type = issue.type
      workItem.summary = replica.summary
      workItem.description = replica.description

      //workItem.description = nodeHelper.getIssueType(replica.type?.name)?.name
      workItem.priority = replica.priority
      workItem.labels = replica.labels
      workItem.attachments = attachmentHelper.mergeAttachments(workItem, replica)
      workItem.comments = commentHelper.mergeComments(workItem, replica)

      //Time Tracking
      if(replica.originalEstimate) {
      workItem."Microsoft.VSTS.Scheduling.OriginalEstimate" = (replica.originalEstimate as Double)/3600
      }
      if(replica.estimate) {
      workItem."Microsoft.VSTS.Scheduling.RemainingWork" = (replica.estimate as Double)/3600
      }
      if(replica.spent) {
      workItem."Microsoft.VSTS.Scheduling.CompletedWork" = (replica.spent as Double)/3600
      }

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

        Hello Ken, 

        Is it possible to provide outgoing and incoming sync rules from both sides?

        We need to see how the sync is set to be able to help you in a timely manner (smile)


        Thank you!

        1. Ken Vetter

          Hello Mariia.  

          Is there any update on this?

        2. Mariia Horbatiuk

          Hello Ken, I need a bit of time to reproduce the setup and propose a method.

        3. Ken Vetter

          Hello Mariia,

          I have come up with the solution.  On the incoming Azure side I have added this scripting.

          Not sure all of it is required,  I haven't tried commenting out any parts to see.


          //map issue types between source and destination instances.
          def issueTypeMapping = [

          // "remote issue type" : "local issue type"
          "Epic" : "Epic",
          "Feature" : "Feature",
          "Story" : "User Story",
          "Bug" : "Bug",
          "Task" : "Task"
          ]

          if(replica.type.name == "Story") {
          workItem.typeName = "User Story"
          }
          else{
          workItem.typeName = "Task"
          }


          Now if I create a new issue (type Story) in Jira, it will produce a User Story in Azure


        CommentAdd your comment...