Script Validator to Block Transition if Sub-task Status is Not Correct

Hi Guys,


Wondering if anyone out there can help me modify this script to create a validator that will block the transition of the parent item if a Sub-task is not in a specific status.


import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.changehistory.ChangeHistory
import com.atlassian.jira.issue.history.ChangeItemBean
for(ChangeHistory changeHistory: ComponentAccessor.getChangeHistoryManager().getChangeHistories(issue)) {
    for(ChangeItemBean changeItemBean: changeHistory.getChangeItemBeans()) {
        if (changeItemBean.getField().equals("status")) {
            if(changeItemBean.getFromString().equals("Client Approved"))
            return true
return false 

 Thanks as always.



1 answer

0 vote

So you don't actually have to create a custom validator script to achieve this.   JIRA actually does have a workflow Condition (not a Validator) called Sub-Task Blocking Condition that you can use to block the transition of the parent issue based on the status of the subtasks of that issue.   It allows you to select the specific statuses that subtask has to be in, in order to then execute this parent's transition.


Does this help?  Sorry if it does not, just wondering if you were trying to use a custom validator for some other reason I might not have considered.

Hi Andy,


Thanks for the suggestion. I am aware of this condition type. The reason I want to see if a validator is possible is because When a condition is not met the transition button does not appear. This lack of info can be confusing to some users. So I want the button to be visible, but if sub-tasks are not in the specified status an error message will be displayed with instructions on what they need to do.


Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,189 views 13 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot