Originally asked by Destri Weir on 28 January 2022 (original question)
I’m using Jira Cloud with a Visual Sync and some scripting. Right now my sync is working perfectly for everything except for Affects version. We have automation that creates the versions in all projects when it’s created in one, so it’s not an issue of the version not existing.
Also, prior to deciding to move to a visual sync plus script when I was just using script, the version sync was working just using the replica.version = issue.version code, but that also doesn’t work in this case.
I am using a direct cut and paste of the script suggested here: https://docs.idalko.com/exalate/display/ED/Script+rules+examples
Here is my script:
// assign fix versions from JIRA A to JIRA B
ServiceDesk.fixVersions = Main
.fixVersions
// ensure that all the fixVersions are available on B
.collect { v -> nodeHelper.createVersion(issue, v.name, v.description) }
// assign affected versions from JIRA A to JIRA B
ServiceDesk.issue.affectedVersions = Main
.affectedVersions
.collect { v -> nodeHelper.createVersion(issue, v.name, v.description) }