This article shows how to stop the sync automatically once the issue has been moved to another project.
Introduction
The synchronization is set up to sync issues from the specific project automatically.
Now, if the issue has been moved from the project under sync to another project which has a different workflow, the synchronization should be stopped automatically.
Jira On-Premise
Continue the sync, but don't apply any changes if the issue has been moved to another project.
Source side
if (!firstSync && issue.project.key != "HELP") {
return
}
Destination side
if (firstSync && replica.project.key != "HELP") {
return
}
Stop the sync if the issue has been moved
Source side
if (!firstSync && issue.project.key != "HELP") {
final def _syncInitService = com.atlassian.jira.component.ComponentAccessor
.getOSGiComponentInstanceOfType(com.exalate.api.trigger.ISyncInitiationService.class)
_syncInitService.unexalate(issueKey.id as String)
return
}
Jira Cloud
Continue the sync, but don't apply any changes if the issue has been moved to another project.
Source side
if (!firstSync && issue.project.key != "HELP") {
return
}
Destination side
if (firstSync && replica.project.key != "HELP") {
return
}
Stop the sync if the issue has been moved
Source side
if (issue.project.key != "HELP") {
if (!firstSync) {
syncHelper.unExalateAfterProcessing()
}
return
}