Workflow Validator fails

DaveF June 8, 2015

I'm struggling to build a validator on transition. It's gotten to the point where I have the following script:

def oneOpen = false

oneOpen == true

With an error message: All Defects must be closed before the issue can be transitioned.

The error message will appear against the Summary field.

 

When running JIRA throws the following error:

It seems that you have tried to perform an illegal workflow operation.

If you think this message is wrong, please contact your JIRA administrators.


I'm running JIRA v6.4.3, Script runner .0.14.

 
What am I doing wrong?

 

1 answer

0 votes
clem
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2016

This is happening to me as well.

 

This is my code:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import com.opensymphony.workflow.InvalidInputException
import com.atlassian.jira.issue.IssueFieldConstants
import com.opensymphony.workflow.InvalidInputException
import webwork.action.ActionContext

def issueLinkManager = ComponentAccessor.getComponent(IssueLinkManager)
log.error("Outward Link: " + issueLinkManager.getOutwardLinks(issue.getId()).size())
log.error("Inward Link: " + issueLinkManager.getOutwardLinks(issue.getId()).size())
log.error("All Links: " + issueLinkManager.getIssueLinks(issue.getId()).size())

if (issueLinkManager.getOutwardLinks(issue.getId()).size() > 0){
throw new InvalidInputException("You cannot delete an issue with 1 or more links.")
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events