Originally asked by Ariel Aguilar on 03 September 2021 (original question)
I face an issue when I want to synchronise Cascading Field.
Everything goes well when we create an Issue, it works, but when after creation we try to edit the cascading field, the destination issue is not syncing.
You’ll find the sync code of cascading list bellow.
Outgoing Sync : Source Issue
replica.customFields.“13863” = issue.customFields.“13863”
Incomming Sync : Destination Issue
//check if at least one option value exists and sync only existing values
String sourceDemandeurParent = replica.customFields.“13863”?.value?.parent?.value
String sourceDemandeurEnfant = replica.customFields.“13863”?.value?.child?.value
if(sourceDemandeurParent != null)
{ issue.customFields.“11700”.value = nodeHelper.getCascadingSelect( nodeHelper.getOption(issue, 13863L, “1”), nodeHelper.getOption(issue, 13863L, “GESSI”) ) }
else if (sourceDemandeurParent == null)
{ issue.customFields.“13863”.value = null }
Comments:
Ariel Aguilar commented on 04 September 2021
Hi there,
The Outgoing code seems to be fine, but for incoming sync maybe you should try:
def sourceDemandeurParent = replica.customFields."13863"?.value?.parent?.value
def sourceDemandeurEnfant = replica.customFields."13863"?.value?.child?.value
if(sourceDemandeurParent != null)
{ issue.customFields."11700".value = nodeHelper.getCascadingSelect( nodeHelper.getOption(issue, 13863L, sourceDemandeurParent), nodeHelper.getOption(issue, 13863L, sourceDemandeurEnfant) ) }
else if (sourceDemandeurParent == null)
{ issue.customFields."13863".value = null }
Kind regards,
Ariel
larbi-externe.el-alami@enedis.fr commented on 06 September 2021
Hello Ariel Aguilar ,
Same problem with you’re code, I have the following log:
2021-09-06 14:01:11,151 pool-46-thread-1 DEBUG anonymous [c.e.n.hubobject.v1_3.NodeHelper] Could not find options for project `PRJ` and type `User Story` on custom field with id `13863`
2021-09-06 14:01:11,151 pool-46-thread-1 DEBUG anonymous [c.e.n.hubobject.v1_3.NodeHelper] Could not find options for project `PRJ` and type `User Story` on custom field with id `13863`
I have the same context in the two instance for the cascading customfield