Hi
I am building a custom scripted validator in Groovy and within my script I need to identify whether the current issue is a type of sub-task. Is there a way I can check this?
Hi @Graeme Johnson
The sure is a way to check this and it's very easy:
if( issue.issueType.subTask){ //do something for sub-task issue types} else { //do something for parent issue types}
Thanks, that worked a charm.
What if we want to check if current issue contains a particular Sub-Task named "abc" ?
You could try something like this:
def abcSubtaskFound = falseif(issue.subTaskObjects){ abcSubtaskFound = issue.subTaskObjects.any{it.issueType.name == 'abc'}}
Or as a oneliner:
def abcSubtaskFound = issue.subTaskObjects && issue.subTaskObjects.any{it.issueType.name == 'abc'}
It looks like you're new here. Sign in or register to get started.