Hi,
I need to define a script validator and I have no experience on it. Where can I find examples or manuals to do that?
Thanks in advance
Begoña
Not sure if is that what you are looking for, but there is a few examples in the link below:
https://jamieechlin.atlassian.net/wiki/display/GRV/Validators
Cheers!
Teilor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Of course depends how complex the validations are, but here a simple example (for issue type 'Bug' the field AffectedVersion should be filled:
import com.atlassian.jira.issue.Issue import com.opensymphony.workflow.InvalidInputException Issue myIssue = issue if (myIssue.getIssueTypeObject().getName() == "Bug") { if (! myIssue.getAffectedVersions().size()) { invalidInputException = new InvalidInputException("versions", "Affects Version/s is required in this context.") } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc Minten (EVS),
I need help with something similar as well.
I have a workflow with multiple projects in it.
I want to make a field required in one of the Projects. (lets say ABC)
I want to make the Sprint field required in this project ABC when the user moves the issue from "Submitted to Assigned" state.
I've tried doing it by modifying your code but it's not working.
Could you help me out?
I'd appreciate the help. Many thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Following these examples I've witten a script groovy only with the following code:
import com.opensymphony.workflow.InvalidInputException
import org.apache.log4j.Category
log.info("START - VALIDATOR");
log = Category.getInstance("com.onresolve.jira.groovy.example.testValidator")
invalidInputException = new InvalidInputException("Validation failure")
log.info("END - VALIDATOR");
I've defined a Validation "Script validator" in "Create" action where this script is invoked but when I launch "create issue" I can create issues with any problem.
I'm sure I haven't understood how Script validators works...... any help?
Thanks in advance
Begoña
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's almost identical to the simple example in the link Teilor and me provided. Honestly, I don't see why it is not working.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, sorry was in holiday. Your script seems to be ok to me. Did you find any errors in the log file ? Did you find the logging info ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What about here: https://jamieechlin.atlassian.net/wiki/display/GRV/Validators
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.