How to Sync Custom Field Checkboxes from Jira Server to Jira Cloud

Originally asked by Gilbert Humarang on 16 September 2021 (original question)


I sync multiple ticket from Jira Server to Jira Cloud with a Custom Field Checkboxes. However, the ticket that I sync to Jira Cloud did not showed the checkboxes options that I selected from Jira Server. I’m not familiar with scripting. Would you be able to help me with the correct scripts or syntax?

Example:

Exalate Sync

Jira Server Ticket # IT-300
Type of Services: Network, Infrastructure, Application

Result

Jira Cloud Ticket # IT-30
Types of Services: None

Jira Server Custom Field Checkboxes:

Checkbox Custom Field = Type of Services
Options:
Helpdesk
Application
Network
Infrastructure
Cloud

Scripts:

Jira Server Source (Outgoing)
replica.customFields.“Types of Services” = issue.customFields.“Types of Services”

Jira Cloud Destination
Incoming
def checkboxCollection = replica.customFields.“Types of Services”.
value?.
collect{
a->
nodeHelper.getOption (issue, “Types of Services”, a.value)
}
issue.customFields.“Types of Services”.value = checkboxCollection


Comments:

Ariel Aguilar commented on 17 September 2021

Hi Gilbert,

This script is just fine, what you are doing on the Jira Incoming script is to collect all values of the remote checkbox and find the corresponding value, however it will ignore in case the value is not found. Are the values exactly the same on both sides? If not, you might need to add a mapping or an additional condition.

Kind regards,

Ariel

Gilbert Humarang commented on 17 September 2021

Hi Ariel,

The value on both side is the same (identical).

Gilbert Humarang commented on 17 September 2021

In which part of the scripts I will put the value. Would you be able to provide or add in the scripts I provided? Example of the value are the following:

Helpdesk

Network

Cloud

Infrastructure

Application

Jose Lobo commented on 21 September 2021

HEy Gilbert Humarang

Do you have the checkbox options on both ends?