Hi,
I am using the following 'Custome Script Post Function' on 'Create' transition and is the first post-function and does not seem to work. It is checking for the issue type of a ticket, based on the issuetype a Custom field(select list) needs to be set up to a certain value 'XYZ':
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
def customerPriority = issue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_12345"));
if(issue.issueTypeObject.name == "ABC")
{
issue.setCustomFieldValue(customerPriority,'XYZ')
}
issue.store();
Any suggestions as to what might be wrong with the above code?
Thanks,
Rupa