Hi,
I am using following in post function to assign the ticket based on the value of mytextbox.
switch(ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("mytextbox").toString()){
case "Loan": userName = "admin";break;
case "Car": userName = "ali";break;
}
issue.setAssignee(ComponentAccessor.getUserManager().getUserByName(userName))
But following line is returning field name instead of field value.
ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("mytextbox").toString()
Kindly help.
Hello @Syed Salman
Here right method to get custom field value
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObjectByName("somecfname")
def customFieldValue = issue.getCustomFieldValue(customField).toString()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.