Hi
It is necessary to set up the synchronization of fields between the two jira. The teams field cannot be passed from the Tempo plugin. The field is not even displayed in Remote replica. How can this problem be solved?
THE SCRIPTS
// SYNC NFEED VALUES / ELEMENT CONNECT
def syncNfeed = { String remoteCfName, String cfName ->
def cfm = com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager()
def cf = issue.customFields[cfName] ? cfm.getCustomFieldObject(issue.customFields[cfName].id) : null
if (cf) {
def cft = cf.getCustomFieldType()
issue.customFields[cfName].value = cft.getSingularObjectFromString(replica.customKeys[remoteCfName])
} else {
log.warn("Custom field '${cfName}' not found on issue.")
}
}
if (firstSync) {
issue.projectKey = "MEDIMP"
def typeMapping = ["Настройка": "Setup", "Консультация/поддержка": "Consultation/support", "Техническая задача": "Technical problem", "Подключение оборудования": "Equipment installation", "Запрос на изменение": "Change request", "Обучение": "Learning"]
def originalTypeName = replica.customFields."13100"?.value?.value
def issueType = typeMapping[originalTypeName] ?: "Setup"
issue.typeName = issueType
def priorityMapping = ["Неотложный": "Highest", "Высокий": "High", "Средний": "Medium", "Обычный": "Low", "Lowest": "Lowest"]
def priorityName = priorityMapping[replica.priority?.name] ?: "Medium"
def statusMap = ["В работе 3ЛП": "Open"]
def localStatus = statusMap[replica.status?.name]
if (localStatus) {
issue.setStatus(localStatus)
}
// def productMapping = ["12071": "10250"]
// def originalProductName = replica.customFields."11238"?.value?.id
// def issueProduct = productMapping[originalProductName] ?: "10250"
issue.reporter = nodeHelper.getUserByUsername(replica.assignee?.username)
issue.priority = nodeHelper.getPriority(priorityName)
issue.summary = replica.customFields."11110"?.value
issue.description = replica.customFields."11109"?.value
issue.customFields."10202" = replica.customFields."10202" // Команда
issue.customFields."10327"?.value?.value = replica.customFields."11238"?.value?.value // Продукт
syncNfeed("Модуль", "11109")
syncNfeed("Субъект", "10310")
syncNfeed("Компонента", "11110")
syncHelper.syncBackAfterProcessing()
}
// issue.comments = commentHelper.mergeComments(issue, replica, {it.internal = true; it})
issue.comments = commentHelper.mergeComments(issue, replica)
issue.attachments = replica.attachments
// END: SYNC NFEED VALUES
def statusMap = ["В работе 3ЛП" : "To Do", "В работе" : "Done", "Закрыт" : "Closed", "Закрыта СТП" : "Closed"]
if(!firstSync) {
issue.setStatus(statusMap[replica.status.name])
}