I would like to identify all subtasks under the user story with proper value in the custom field, The idea is that if such exists than the transition should be disabled.
I have written something like that:
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) == "Development test"}
!subtasks.any { subtask -> !subtask.getResolutionObject() }
Unfortunately, the list of subtasks is empty and looks that it.getCustomFieldValue(cf) == "Development test" doesn't work. Could you help me with fixing it ?
Thanks in advance.