I have the following code in order to sync fixVersions filed with customer “Fix in versions” filed:
issue.customFields.“Fix in version”.value = replica.fixVersions?.collect
you can try by comparing with previous fixVersions
previousFixVersions = previous?.fixVersions
currentFixVersions = replica?.fixVersions
if (previousFixVersions != currentFixVersions){
//your code here
}
or
if (!replica?.fixVersions?.equals(previous?.fixVersions){
//your code here
}
Nota: there is a known issue in Groovy causing that x.equal.y sometimes is not the same as x == y. The first option always worked for me.