Help adding script to a Visual Mode connection

Originally asked by Daniel Carvajal on 12 August 2021 (original question)


Question by B Wright:
I’m seeking to add a Checkbox custom field to an existing Visual Mode connection rule:
Guidance here (https://docs.idalko.com/exalate/display/ED/Script+rules+examples#Scriptrulesexamples-Multi-selectlist/Checkbox) suggests using the following format:

your_instance_shortname.issue.customFields.“select list multiple choice”.value = remote_instance_shortname.issue.customFields.“remote multi-select list custom field”.value?.value

Can you please confirm what precise information should be added for remote_instance_shortname and your_instance_shortname?
I tried the following - it allows the issue to sync but doesn’t result in the Product custom field being synced: ITSM.issue.customFields.“select list multiple choice”.value = Data.issue.customFields.“remote multi-select list custom field”.value?.value


Comments:

Ariel Aguilar commented on 12 August 2021

Hi there!

If you create a connection with local name A and remote instance name B, the connection name would look like this: A_to_B. Then, if you want to replace the mentioned “remote_instance_shortname and your_instance_shortname”, you should do something like this:

A.issue.customFields."select list multiple choice".value = B.issue.customFields."remote multi-select list custom field".value?.value

Let me know if you require more help.

Kind regards,

Ariel

Ben commented on 16 August 2021

Hi Ariel,

Thanks. Unfortunately, I get a sync error using the above script with the local and remote instance names.

Ariel Aguilar commented on 16 August 2021

Hi Ben,

Could you add the error stack trace as reference. It is helpful to specify the type of field used for better understanding.

Please check the quotes on the script, they should be (“”) and are you replacing the name of the customfield, correct? For example, replace “select list multiple choice” by its actual name.

Kind regards,

Ariel