Hi everyone,
Hope this question finds you well.
On create screen, I want to be able to determine who is the assignee based on the chosen value of a drop down custom field. (using Behaviour Script)
I looked here but the answers given seem to point after the issue has been created.
And others that I looked also most of them handle after the issue has been created,
Here is my code:
void setAssignee(){
FormField ffAssignee = getFieldByName("Assignee")
String value = getFieldById(customfield_id).getFormValue()
if (value in HERE){
ffAssignee.setAssigneeId("name.lastname")
} else if (value in THERE){
ffAssignee.setAssigneeId("name.lastname")
}
}
I tried this as suggested in here (given in link above as answer), but still could not get it to work
void setAssignee(){
FormField ffAssignee = getFieldByName("Assignee")
String value = getFieldById(customfield_id).getFormValue()
if (value in HERE){
ffAssignee.setAssignee(ComponentAccessor.getUserManager().getUserByKey("name.lastname"))
} else if (value in THERE){
ffAssignee.setAssignee(ComponentAccessor.getUserManager().getUserByKey("name.lastname"))
}
}
Any pointers would be helpful!