I Have 2 single select custom field.
Ex: Field1 : (1,2,3,4,5) as drop down values
Field2 : (A,B,C,D,E) as drop down values
Based on selection of above fields, Priority System field as to be set as defined.
For Ex: if Field1 = 1 && Field2 = A, Priority to be set as High
Filed1 = 2 && Field2 = B, Priority to be set as Medium
Filed2 = 3 && Field2 = C, Priority to be set as Low ------etc.
as a start, i have tried with following code applied at post function of create transition,
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.PriorityManager
final cFieldName = "Testing Select Field"
//Get custom field issue with this name
def customFieldManager = ComponentAccessor.customFieldManager
def cField = customFieldManager.getCustomFieldObjects(issue).findByName(cFieldName)
def sField = customFieldManager.getCustomFieldObjects(issue).findByName(sFieldName)
def priorities = ComponentAccessor.getComponent(PriorityManager).priorities
def HighestId = priorities.findByName("Highest").getId()
if (cField.getValue(issue) == 1){
issue.setProjectId(HIghestId)
}
Please help me on it.
Thanks in Advance