I have to put a postfunction on a create transition that spins off another standard issue in the same project. It needs to add a component to the spun-off ticket. I can clone the ticket fine but when I add this code (stolen from a spin-off-a-SUBTASK postfunction), the whole thing dies with "issue=null." Does anyone know the right code? Thank you.
issue.summary = 'Chesapeake Center Catering Request'
import com.atlassian.jira.component.ComponentAccessor;def p = issue.getProjectObject()def c = ComponentAccessor.getProjectComponentManager().findByComponentName(p.getId(), "Conference Event Catering")
if (c) {
issue.setComponent([c])
issue.setAssigneeId(c.lead)
}