It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to check if subtask exists ?

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 { == '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

1 answer

1 accepted

0 votes
Answer accepted

I have found the solution: It shouldn't be issue.subTaskObjects but subtasks and it works

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

221 views 4 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you