# Sync cascading field

**URL:** <https://community.exalate.com/t/sync-cascading-field/4760>\
**Category:** General Questions\
**Tags:** exalate, migrated\_question\
**Created:** [November 4, 2024, 7:21am UTC](https://community.exalate.com/t/sync-cascading-field/4760 "2024-11-04T07:21:50Z")\
**Posts on this page:** 4\
**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, 7:21am UTC](https://community.exalate.com/t/sync-cascading-field/4760/1 "2024-11-04T07:21:50Z")

</div>

_Originally asked by Vimalraj Rangasamy on 01 July 2021 [(original question)](https://oldcommunity.exalate.com/questions/30049045)_

* * *

I’m trying to sync cascading fields. I tried hard coding as below, but it did not work.

OEM.issue.customFields.“OEM Test Found In”?.value = “Development”

Also, I have issues with multi select field sync. Kindly request assistance.

* * *

#### Comments:

> **Ariel Aguilar commented on 01 July 2021**
>
> > Hi Vimalraj,
> 
> We understand you are using a scripted or visual connection? With your piece of code, you are assigning a default value to the local custom field, in this case the value set is “Development”.
> 
> Please indicate, what Jira or instances do you have? Are you trying to sync a cascade custom field with another cascade custom field? Please indicate the same for the multi select field sync question.
> 
> Kind regards,
> 
> Ariel

---

<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, 7:21am UTC](https://community.exalate.com/t/sync-cascading-field/4760/2 "2024-11-04T07:21:51Z")

</div>

_Answer by Vimalraj Rangasamy on 13 July 2021_

Hello Ariel,

I’m trying to set default value to start with. However, i’m getting below error

def DARparent = nodeHelper.getOption(issue, “Test Found In”, “Development”)  
issue.customFields.“Test Found In”.value = nodeHelper.getCascadingSelect(  
DARparent,  
DARparent.childOptions.find

{it.value == “Feature Development”}  
)

def OEMparent = nodeHelper.getOption(issue, “OEM Test Found In”, “Development”)  
issue.customFields.“OEM Test Found In”.value = nodeHelper.getCascadingSelect(  
OEMparent,  
OEMparent.childOptions.find{it.value == “Feature Development”}

)

ERROR:  
NullPointerException: Cannot get property ‘childOptions’ on null object

Please assist.

* * *

---

<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, 7:21am UTC](https://community.exalate.com/t/sync-cascading-field/4760/3 "2024-11-04T07:21:52Z")

</div>

_Answer by Vimalraj Rangasamy on 09 July 2021_

Hi Ariel,

I’m trying sync between to projects in a single instance. Please confirm how it can be managed with above snippet.

Thanks

* * *

---

<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, 7:21am UTC](https://community.exalate.com/t/sync-cascading-field/4760/4 "2024-11-04T07:21:52Z")

</div>

_Answer by Vimalraj Rangasamy on 02 July 2021_

Hello Ariel,

We have Jira server instance and i’m trying to sync between 2 issue types within same Jira server instance. I was trying to sync between 2 cascading fields.

DAR.issue.customFields.“Test Found In”?.value = OEM.issue.customFields.“OEM Test Found In”.value?.value

Both “Test Found In” and “OEM Test Found In” are cascading fields.

For Multi select field, I was trying to sync between 2 multi select fields

DAR.issue.customFields.“Affected Programs”.value = OEM.issue.customFields.“OEM Affected Programs”.value?.value

Both “Affected Programs” and “OEM Affected Programs” are multi select fields.

Please assist. Thanks.

* * *

#### Comments:

> **Ariel Aguilar commented on 08 July 2021**
>
> > Hi Vimalraj,
> 
> You may want to try adding the following snippet for cascade select list for visual connection script:
> 
> ```auto
> if (executionInstanceName == "OEM") {
> // issue is from "OEM", replica is from "DAR"
> //In the script you may also replace the issue variable with OEM.issue and replica with DAR.issue
> 
> def sourceOption1 = DAR.issue.customFields."Test Found In"?.value?.parent?.value
> def sourceOption2 = DAR.issue.customFields."Test Found In"?.value?.child?.value
>  
> def option1 = nodeHelper.getOption(
> issue,
> "OEM Test Found In",
> sourceOption1
> )
> def option2 = option1.childOptions.find{it.value == sourceOption2}
> if ( option1 != null && (sourceOption2 == null || option2 != null)) {
> OEM.issue.customFields."OEM Test Found In"?.value = nodeHelper.getCascadingSelect(
> option1,
> option2
> )
> } else if (sourceOption1 == null) {
> OEM.issue.customFields."OEM Test Found In"?.value = null
> }
> }
> 
> ```
> 
> If you require more information, please refer to: [https://docs.idalko.com/exalate/x/bwSOAQ](https://docs.idalko.com/exalate/x/bwSOAQ)
> 
> Let me know if this works for you.
> 
> Kind regards,
> 
> Ariel
