I would like to have the transition visible only if appropriate subtask exists and it is resolved.
I wrote:
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cf = customFieldManager.getCustomFieldObjectByName("Test type")
def subtasks = issue.getSubTaskObjects().findAll { it.issueTypeObject.name == 'Sub Test Execution' && it.getCustomFieldValue(cf)?.value == "Development test"}
issue.subTaskObjects && !subtasks.any { subtask -> !subtask.getResolutionObject() }
But looks that issue.subTaskObjects (in my opinion it should check if such subtask exists) doesn't work.
Could you help me ?
Thanks in advance