Sync Custom field (Dropdown, select list) in Jira cloud to Element connect custom field in Jira server

Originally asked by Vinay on 09 September 2021 (original question)


We tried below script but this is not working as expected

def hobbyMap = [“Academy”: “0010”, “Lulu”: “0010”, “Pet”: “0010”, “Sep”: “0010”]
def remoteHobbies = replica.customFields." 10635 “?. Value? .Value
issue.customFields.” desinationcustomfield ".value = remoteHobbies.collect{hobbyMap [it]?: it}


Answer by Ariel Aguilar on 11 September 2021

Hi Vinay,

Please make sure to check on syntax, since this should work:

def hobbyMap = ["Academy": "0010", "Lulu": "0010", "Pet": "0010", "Sep": "0010"] // ["remote options" : "local option"]
def remoteHobbies = replica.customFields."10635"?.value?.value
issue.customFields."destinationcustomfield".value = remoteHobbies.collect{hobbyMap[it] ?: it}

Kind regards,

Ariel


Comments:

Vinay commented on 17 September 2021

Source Custom field type(Jira Cloud) : Select List (multiple choices)

Destination Custom field type(Jira Server) : Elements Connect - Live - Text (legacy)

Please test at your end with the above script. It is not working for me