Workflow Validator Not Working As Expected

I am try to create a workflow validator but instead of getting the message I put in my code I get 

This is my code:

import com.atlassian.jira.component.ComponentAccessor
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.")


Instead it gives me:

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

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

2 answers

1 accepted

0 votes
Accepted answer

Do you have any screen configured in your transition?

If you don't have any, message is a little confusing. When you add a screen it will look much better.


You can also use Workflow PowerBox Plugin which delivers "Number of related issues validator" you can configure without scripting smile

Thanks.  I can see the error I throw now with my transitions screen.

As Robert says, you get this message if you try to add a validator and there is no screen configured. Possibly it only happens when you specify that the error message should be associated with a field. It's a JIRA bug.

Hey Jamie,

Do you know of anyway to remove the default error messages? I want only the message configured in the scripted validators to be shown. Not using condition for this as I want the transition for the workflow to be shown. Using condition will just hide the transition for users outside those roles, can be confusing for new users


2018-07-11 16_02_43-Workflow Error - JIRA Development.png

Like 1 person likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

227 views 6 0
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