Confluence has been updated to version 6.15.9

This article shows how to synchronize a label custom field.

Source side

Outgoing sync

Assume you want to synchronize the label custom field 'label - cust1'

replica.customFields."label - cust1" = issue.customFields."label - cust1"

Destination side  

Incoming sync 

  • Set the received label to the local label custom field and if it doesn't find one, it sets an empty array so you don't get a null pointer exception. 

(warning) This method overrides all the existing labels in the custom field.

  • issue.customFields."label - cust1".value = replica.customFields."label - cust1"?.value ?: []

  • Add the received label into the local label custom field

    issue.customFields​."Labels".value + = replica.customFields."label - cust1"?.value

How to set a default value in a label custom field

To set a default value in a label custom field use the nodeHelper.getLabel method.

issue.customFields."Epic/Theme".value = replica.customFields."Tags"?.value ?: [
                nodeHelper.getLabel("")
]

See Also