How to get a count number of sub-task within a parent issue through a JQL search and/or through a JIRA script field?
Hi,
Scripted field code:
issue.getSubTaskObjects().size()
I do not thing you can return a number with JQL but you can get all subtask of an issue with
issueFunction in subtasksOf("subQuery");
Thanks,
HOw to get count of specific sub-tasks only? I have more than one sub-tasks.
Try iterating through the returned collection and checking the issue type of each subtask:
Collection<Issue> subTasks = issue.getSubTaskObjects(); IssueType issueType = ComponentAccessor.getConstantsManager().getIssueTypeObject("Bug"); int count = 0; for (Issue i : subTasks) { if (i.getIssueTypeObject().equals(issueType)) // or some other check count++; }
yes:
issue.getSubTaskObjects().findAll { it.getIssueTypeObject()?.getName() == "task type name you want" }.size()
I like it to be more Groovy'ish
It looks like you're new here. Sign in or register to get started.