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.