1
0
-1

Current flow: ZD → Jira. All statuses in ZD need to map with the status in Jira.


Use case: I only want, "Open" and "Solved" statuses from ZD to be mapped to  "Open" and "Done" status in Jira, but while doing so, in the rest of the status I am getting errors and the ticket is not syncing.


Please suggest, if that could be possible.

    CommentAdd your comment...

    3 answers

    1.  
      2
      1
      0

      Yes, this should be very possible. The trick here is to only allow a status change in Jira when you want it. Something on the lines of the following code snippet (not tested) should do the job:



      def statusMap = [
         "open" : "Open",
         "solved" : "Done"
      ]
      def remoteStatusName = replica.status.name
      if (remoteStatusName == "open" || remoteStatusName == "solved")
               issue.setStatus(statusMap[remoteStatusName]



      Please let me know how it goes. 


      Thanks

      Majid

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

        No, in fact I left the bold part out on purpose. This is the default value that the system relies on if it does not find a match in the map you created. I would personally not include it from the initial description you provided, but if you are all set, that is great to hear!

        Thanks

        Majid


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

          Thanks Syed Majid Hassan , it seems working, I believe you forgot to add the bold part in the below code, by using it its working.


          Code: issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName) 

            CommentAdd your comment...