How can we avoid erasing value when replica is empty

Originally asked by Salma Nairi on 11 November 2021 (original question)


Hi

we synchronize a Labels from A to B only → unidirectional synchronization

but when we set labels in instance B and labels in instance A is empty → lables in B are erased

How can we avoid this behavior , and don’t sync empty value from replica

it’s quick urgent :smile:

Thanks a lot


Answer by Salma Nairi on 15 November 2021

hi

sorry , i re tested this implementation but it doesn’t work

labels null value always erase values on destination side

very strange , a control is not checked


Answer by Ariel Aguilar on 11 November 2021

Hi Salma,

Maybe you can try to add to the Incoming sync:

if (replica.labels != null) {
issue.labels = replica.labels
}

Then on the B side, you should look after the outgoing script I know you said it should be unidirectional, but if there is an outgoing sync rule that needs to be removed. It might need to be adjusted.

Kind regards,

Ariel


Comments:

Salma Nairi commented on 12 November 2021

Hi

thanks for your quick response

i put control on ongoing rules and value is not erased

if (issue.labels != null) {

replica.labels = issue.labels

}