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.
Below script may give you some idea, I haven't tried by myself so may require some minor changes
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.project.ProjectManager
import com.atlassian.jira.project.version.VersionManager
def projectManager = ComponentAccessor.getProjectManager()
def project = projectManager.getProjectObjByKey("KEY")
def versionManager = ComponentAccessor.getVersionManager()
versionManager.createVersion("Version Name", new Date(), new Date()+7, "New Version Description",project.id, null)
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.