Check that all issues that this one is blocked by are resolved. You might want to put this on the Resolve Issue transition.

import com.atlassian.jira.component.ComponentAccessor

def linkType = ["Blocks"]

def linkMgr = ComponentAccessor.getIssueLinkManager()
for (IssueLink link in linkMgr.getInwardLinks( {
    if (linkType.contains( {
        if (! link.sourceObject.resolutionId) {
            passesCondition = false


For how-to questions please ask on Atlassian Answers where there is a very active community. Adaptavist staff are also likely to respond there.

Ask a question about ScriptRunner for JIRA, for for Bitbucket Server, or for Confluence.