2
1
0
2 answers
- 210
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 }
Add your comment... - 10-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?
- 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.
- 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)
Add your comment...
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:
JIRA Incoming: