1
0
-1

Hi,
when I am starting the sync from JIRA cloud to Zendesk, I am transferring the resolution field from JIRA to ZD.
But in the case, when this field is not set in JIRA the value is null...how can I set their a default value, so that I am not getting an error?


Thanks for Help.
Kazi

def resoMap = [
            "Fixed": "fixed", 
            "No Bug": "no_bug",
            "Blocked": "won_t_fix",
            "Duplicate": "duplicate",
            "Incomplete": "incomplete",
            "Cannot Reproduce": "cannot_reproduce",
            "Done": "done",
            "Won't Do": "won_t_do",
            "Declined": "declined",
]
issue.customFields."[JIRA] Resolution".value=resoMap[replica.resolution.name]

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Thank you for joining the call earlier today. We were able to resolve this with the following snippet:



      if (replica.resolution?.name)
      
         Assign the resolution to the ZD field
      
      else
      
        Assign default to ZD field



      Thanks

      Majid


      1. Syed Majid Hassan

        Hi Kazim Yildirim ,

        I believe we completed this on call. 
        Please mark the answer accepted if all is well. 

        Thanks

        Majid


      CommentAdd your comment...