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.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.")
}
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.
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
Thanks. I can see the error I throw now with my transitions screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.