Calculate and compare the fields, calculate A+B=C. If the A+B score is less than 9, the priority is P1. If it is greater than or equal to 9, the priority is P0. Please guide me!
def sampleListValue = issue.getCustomFieldValue('A')
def sampleListValue2 = issue.getCustomFieldValue('B')
def priority = issue.priority.name
def sampleListValueMap = ['A1':10, 'A2':5, 'A3':2] as Map<String, Long>
def sampleListValue2Map = ['S':3, 'M':2, 'L':1] as Map<String, Long>
def priorityValueMap = ['P0','P1','P2','P3','P4']
if (sampleListValue && sampleListValue2) {
def option1 = sampleListValueMap[sampleListValue.toString()] as Long
def option2 = sampleListValue2Map[sampleListValue2.toString()] as Long
priority = (option1 + option2) as Long
} else {
0
}