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?
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.")
}
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.