Hello community!
I try to make transition in scriptrunner custom listener, but I have
It seems that you have tried to perform a workflow operation (251) that is not valid for the current state of this issue (XXXXXX). The likely cause is that somebody has changed the issue recently, please look at the issue history for details.
Event is Issue Created
I check workflow and there is a transition with id 251 (which i need)
My custom listener

if (summary.contains("Invalid item requisites")){
IssueService issueService = ComponentAccessor.getIssueService()
def issueInputParameters = issueService.newIssueInputParameters()
def user = ComponentAccessor.getUserManager().getUserByName('admin')
def transitionValidationResult = issueService.validateTransition(user, issue.id, 251, issueInputParameters)
if (transitionValidationResult.isValid()) {
def transitionResult = issueService.transition(user, transitionValidationResult)
if (transitionResult.isValid()){
log.warn("Transitioned issue ${event.issue.key}")
} else {
log.warn("Transition result is not valid")
log.warn(transitionResult.errorCollection)
}
} else {
log.warn("The transitionValidation is not valid")
log.warn(transitionValidationResult.errorCollection)
}
}
But when I try to make that transition like that


Everything works fine.
Why I can't make transition in custom listener?