# Sync Affected Version

**URL:** <https://community.exalate.com/t/sync-affected-version/4144>\
**Category:** General Questions\
**Tags:** onpremise-jira, migrated\_question\
**Created:** [November 4, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144 "2024-11-04T06:34:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144/1 "2024-11-04T06:34:01Z")

</div>

_Originally asked by Berry Kersten on 14 January 2020 [(original question)](https://oldcommunity.exalate.com/questions/8552950)_

* * *

Hi,

I’m trying to sync the field affectedVersions, but I encounter some problems:  
(1) sync to the remote field affectedVersions does not work, because there are different affectedVersions on the source/remote side

(2) sync to a remote label (with incoming sync issue.labels = replica.affectedVersions) returns an error (One or more labels in ‘hubIssue.getLabels’ is not of type IHubLabel but `com.exalate.basic.domain.hubobject.v1.BasicHubVersion)

I don’t want to use a new custom field for that. What is the best practice for this? Maybe sync to a comment with a default text ‘Affected version’ and then the synced field affectedVersions ?

Thanks.Source: [Jira Server/Datacenter](https://oldcommunity.exalate.com/pages/viewpage.action?pageId=3703137)_(old community)_

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144/2 "2024-11-04T06:34:02Z")

</div>

_Answer by Peter Hochstrasser on 14 January 2020_

Hi Berry

This is not really out of the box, but exalate offers a groovy script called Versions.groovy which will allow you not only to sync the value on the issue, but also adds it to the list of versions if required. Search for it - it does the trick.

* * *

#### Comments:

> **Berry Kersten commented on 14 January 2020**
>
> > Hi Peter HochstrasserThanks for the quick reply. I will try that!
> 
> Next to that, is there also an alternative solution for this? For example, sync the source affectedVersions to a comment?

> **Berry Kersten commented on 16 January 2020**
>
> > Hi Peter Hochstrasser, I talked to the stakeholders about this solution, but they did not want to add extra values for Version in the remote project.
> 
> So therefore I tried to sync to a custom field ‘Reported Affected Version’, but I got an error:
> 
> **Exception evaluating property ‘value’ for java.util.LinkedHashSet, Reason: groovy.lang.MissingPropertyException: No such property: value for class: com.exalate.basic.domain.hubobject.v1.BasicHubVersion**
> 
> This is the incoming sync config:
> 
> ```auto
> //sync for project UNI
> issue.customFields."Reported Affected Version".value = replica.affectedVersions.value?.value
> //sync for project UA
> issue.customFields."Reported Affected Version".value = replica.customFields."UA Version Number".value?.value
> //sync for project DLM
> issue.customFields."Reported Affected Version".value = replica.customFields."DLM version".value?.value
> 
> ```
> 
> Any idea how I can fix this? Thanks!

> **Peter Hochstrasser commented on 16 January 2020**
>
> > Hi Berry Kersten
> 
> I expect that you’d need some kind of type conversion between the affectedVersions data type and the string of the custom fields.
> 
> Keep in mind that affectedVersions is potentially a list, not a single value.
> 
> Yours truly
> 
> Peter

> **Berry Kersten commented on 20 January 2020**
>
> > Hi Peter Hochstrasserthanks for the additional info. I’m not sure how to convert the affected versions to text and sync that value.
> 
> Therefore, as an alternative approach, I’ve used the following documentation: [https://docs.idalko.com/exalate/display/ED/Sync+between+Cascading+Select+and+Text+custom+fields](https://docs.idalko.com/exalate/display/ED/Sync+between+Cascading+Select+and+Text+custom+fields) which resulted in the following incoming sync:
> 
> ```auto
> issue.customFields."Reported Affected Version" = replica.affectedVersions?.value?.parent?.value +
> ", " + replica.affectedVersions?.value?.child?.value
> 
> ```
> 
> However, I still get an error:
> 
> Script error for issue UNI-14298. Details: Exception evaluating property ‘value’ for java.util.LinkedHashSet, Reason: groovy.lang.MissingPropertyException: No such property: value for class: com.exalate.basic.domain.hubobject.v1.BasicHubVersion Possible solutions: name. Error line: Script45.groovy:19
> 
> I assumed this method should work in theory as well as the system field affectedVersions is of type Cascading Select, right?
> 
> In case this method does not work, does Exalate provide some kind of “conversion script”?

> **Peter Hochstrasser commented on 20 January 2020**
>
> > Hi Berry Kersten
> 
> There are lots of examples in the community. Also, if you ask iDalko, they are most helpful with their support.
> 
> Just searching for **convert** in the community yielded the following page:
> 
> [https://docs.idalko.com/exalate/display/ED/How+to+convert+remote+status+changes+to+local+comments](https://docs.idalko.com/exalate/display/ED/How+to+convert+remote+status+changes+to+local+comments)
> 
> or this here:
> 
> [https://docs.idalko.com/exalate/display/ED/Script+rules+examples](https://docs.idalko.com/exalate/display/ED/Script+rules+examples)
> 
> The code shown under heading Versions on that page shows you the attributes of (affected/fix)Versions that you might want to retrieve as strings. **value** is not one of them.
> 
> As you see, I try to get you fishing instead of putting the fish in your hand.
> 
> Yours truly
> 
> Peter

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144/3 "2024-11-04T06:34:03Z")

</div>

_Answer by Berry Kersten on 22 January 2020_

Hi Peter HochstrasserThe issue is resolved! I’ve used the info in another Community Question ([How to sync Fix version to custom text field](https://oldcommunity.exalate.com/questions/5668978/how-to-sync-fix-version-to-custom-text-field)_(old community)_)

* * *

#### Comments:

> **Peter Hochstrasser commented on 22 January 2020**
>
> > Great - and have fun with Exalate!

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144/4 "2024-11-04T06:34:04Z")

</div>

_Answer by Peter Hochstrasser on 16 January 2020_

Hi Berry Kersten

You cannot add versions that are not in the list of versions - that’s a JIRA restriction you can’t circumvent.

What you can do instead is

- create a text field
- convert the affected versions to text and sync that value.

Hope this helps.

Yours truly

Peter

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 6:34am UTC](https://community.exalate.com/t/sync-affected-version/4144/5 "2024-11-06T06:34:24Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
