Below is my code using in behaviour script- not working
Requirement: Auto-set Assignee based on cascade field select
import com.atlassian.jira.component.ComponentAccessor
def formhddmo = getFieldByName("cascadefield")
def assigneeField = getFieldById("assignee")
def formassign = getFieldByName("assignee")
//log.debug("----------------> " + formhddmo.getValue())
//log.debug("----------------> " + formhddimos.getValue())
String userName="kiran.p@xxx.com";
List<String> listString = formhddmo.getValue() as List<String>
def parentValue = listString.get(0)
switch(parentValue){
case "Dfgd ACC ART": userName = "jay.asdfsd@xxx.com";break;
case "HDdfgdD Infrastructure ART": userName = "Bryan.asdfsd@xxx.com";break;
case "Dfgsdf Command Flow ART": userName = "Pawan.asfasd@xxx.com";break;
case "Power and Performance": userName = "ajhsdg.Begum@xxx.com";break;
case "FWsdgdTest & Val": userName = "Alexander.Peladtt@xxx.com";break;
case "Sdfgsdfg Fmwre":
switch(formhddimos.getValue()){
case "zdsfgds": userName = "Adam.asdfsd@xxx.com";break;
case "Custosadfmer Enablement": userName = "benjamin.lundd@xxx.com";break;
case "Architecture": userName = "robert.medyer@xxx.com";break;
}
case "Rding Subsystems":
switch(formhddimos.getValue()){
case "Dfgsdfg Integration": userName = "takanori.asdfasd@xxx.com";break;
case "Elec FW": userName = "timothy.schmdalz@xxx.com";break;
}
}
// set Assignee
getFieldById(ASSIGNEE).setFormValue(userName)