How to sync Affect verson field in Jira DC

Originally asked by Anshuman Bakshi on 17 May 2024 (original question)


We want to sync Affect version field from JSM cloud to Jira DC. I don’t find any documentation to sync Affect version field for Jira DC.


Answer by Francis Martens (Exalate) on 17 May 2024

Hi Anshuman Bakshi - I asked the question to aida and I got

To synchronize the “Affects Version” field from Jira Service Management (JSM) Cloud to Jira Data Center (Jira DC), you would typically need to use a scripting approach in Exalate, as detailed syncing instructions for specific fields like “Affects Version” are not explicitly listed for every scenario in the documentation.

Here’s a basic example of how you might set up the synchronization:

### Source Side (JSM Cloud)
```groovy
// In the Outgoing Sync
replica.affectedVersions = issue.affectedVersions



Destination Side (Jira DC)

// In the Incoming Sync
issue.affectedVersions = replica.affectedVersions

\*\*Important\*\*: Ensure that the versions exist on the Jira DC side, or are created dynamically if they don't, to avoid synchronization errors.

For more detailed guidance and to implement specific behaviors like dynamically creating versions that don’t exist on the destination side, you can refer to the general documentation on how to synchronize versions:  
\- For Jira Cloud: \[How to Synchronize Versions in Jira Cloud]([https://docs.exalate.com/docs/how\-to\-synchronize\-versions\-in\-jira\-cloud](https://docs.exalate.com/docs/how-to-synchronize-versions-in-jira-cloud))  
\- For Jira On\-premise: \[How to Synchronize Versions in Jira On\-premise]([https://docs.exalate.com/docs/how\-to\-synchronize\-versions\-in\-jira\-on\-premise](https://docs.exalate.com/docs/how-to-synchronize-versions-in-jira-on-premise))

In cases where specific documentation is not available for certain fields or use cases, it's advisable to explore the general scripting practices provided by Exalate or consult with their support for tailored solutions.



---