Confluence has been updated to version 6.15.9


Recently we had a customer with a request to synchronize JIRA custom field (single select drop-down list) with JIRA Service Desk Organizations field.

Please use scripts below to sync custom field to Service Desk field. 

Sending side

Outgoing sync

replica.customFields."Custom field name" = issue.customFields."Custom field name"

Receiving side

Incoming sync 

def getOrganizationId = { name ->
  if (name == null) {
    return null

  def organizations = httpClient.get("/rest/servicedeskapi/organization") 
  def orgId = organizations?.values?.findAll{ org -> name.equalsIgnoreCase(org?.name) }?.find{it}?.id
  if (orgId != null) {
    return orgId as Long
  return null

def newOrgFromRemote = getOrganizationId(replica.customFields."Custom field name"?.value?.value)
if (newOrgFromRemote != null) {
  issue.customFields."Organizations".value = [newOrgFromRemote]

See Also