2
1
0

I have a one directional sync from assignee in Zendesk to assignee in JIRA. However, if they change the value of assignee in JIRA, I don't want exalate to overwrite it from the zendesk side.


But if they change assignee on the zendesk side, I do want to overwrite it on the Jira side.


This is what I have currently but I believe "previous" is checking the previous value on the JIRA side but I want it to check if it has changed on the Zendesk Side:


Zendesk outgoing:

replica.assignee       = issue.assignee 



JIRA Incoming:

if (replica.assignee != null || (!firstSync && replica.assignee != previous?.assignee)) {
    issue.assignee = userHelper.getByEmail(replica.assignee?.email) ?: defaultUser
} 
    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      This snippet is working:

      Zendesk Outgoing:

      replica.assignee       = issue.assignee 



      JIRA Incoming:

      if ((firstSync && replica.assignee != null) || (!firstSync && replica.assignee != previous?.assignee)) {
          issue.assignee = userHelper.getByEmail(replica.assignee?.email) ?: defaultUser
      }
        CommentAdd your comment...
      1.  
        1
        0
        -1

        Previous is the previous replica.  That way you can check if a certain value has changed between two sync transactions.


        The code snippet looks ok - does it behave as you expect?

        1. Spencer Johnson

          Francis Martens (Exalate)  no when you make the change on the JIRA side, it overrides the value on the JIRA side with the value on the zendesk side. 

        2. Spencer Johnson

          I got it to work. 

          It should have been:

          if ((firstSync && replica.assignee != null) || (!firstSync && replica.assignee != previous?.assignee)) {
              issue.assignee = userHelper.getByEmail(replica.assignee?.email) ?: defaultUser
          }

          Thanks Francis Martens (Exalate)

        CommentAdd your comment...