Using JIRA 5.2.11
I want to validate that when a issue type "Library" is selected, only components that start with "Library" can be selected.
I have to components named "Library - model" and "Library - service"
My validation error displays no matter whether the component is something else or one of the Library ones above.
Please help. Code below.
if (issue.issueTypeObject.name == "Library"){
if(issue.components*.name ==~ /Library.*/){
return true;
} else {
return false;
}
} else {
return true;
}
You're doing a pattern match on a list, which won't work. You want something like (untested):
if (issue.issueTypeObject.name == "Library"){ issue.componentObjects*.name.every { it ==~ /Library.*/ } } else { true; }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @JamieA
I have similar requirement but the List names has a dot.
Like Library.model and Library.service
what is the pattern match of a dot ?
Thanks
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.