I have to make the Fixed version mandatory for a project with key "AN". I add the following script in the simple scripted validator:
issue.projectObject.key == 'AN' && (null in issue.fixVersions*.name)
This workflow is shared with 60 projects, i want this just for the AN project. Right now irrespective of the fix version being empty or not, the error message shows up. I don't want the error if the user enters the value in the fix versions field
This is affecting all the projects which isn't the requirement
Regards
Ganga
Since issue.getFixVersion() returns a collection thus to check for null or empty simply fetching the value should be enough in groovy
thus, try this
if(issue.projectObject.key == 'AN') { if(issue.getFixVersions()) { return true; } return false; } return true;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or in a single statement
!(issue.projectObject.key == 'AN' && !issue.getFixVersions())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are getting the error for all projects as your condition is not right because you are checking the project name, in case there is any other project apart from "AN" then your statement will return false and thus the validation will fail.
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.
Did my answer fix the problem?, if yes, please upvote/accept the answer. thanks.
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.